Hi guys a have a very simple question.
Facts are:
I use the OCI driver to connect to my local Oracle database. Everything works fine, I can update, insert delete without any problems.
Problem is:
Everytime I exec/show a new Widget or Dialog I need to reopen my database connection, even though when I create it, the compiler tells me an old connection has been removed. I`ve tried passing the database point, mem direction (&) and creating a new class the initialices the db but nothing seems to work except opening the connection before I initialize the model. I think that the main problem is the QSqlQuery because if I use a simple QSqlquery i can pass the database as a constructor parameter. Sorry for my poor explanation.
db.setDatabaseName("XE");
db.setUserName("xxxxx");
db.setPassword("xxxxxx");
db.setHostName("127.0.0.1");
db.setPort(1521);
if(db.open ()){
db = QSqlDatabase::addDatabase ("QOCI");
db.setDatabaseName("XE");
db.setUserName("xxxxx");
db.setPassword("xxxxxx");
db.setHostName("127.0.0.1");
db.setPort(1521);
if(db.open ()){
model = new QSqlQueryModel ();
To copy to clipboard, switch view to plain text mode
Thank you all in advance.
PS: Another quick question. Is there a way to call a program to execute before I open my app? Because I want to execute the oracle .bat: StartDB.bat so that the user doesn`t have to do it manually. I know that it starts when the system boots but sometimes for performance of the machine I need to close it for example....
Bookmarks