PDA

View Full Version : database creation error appeared...



GreyGeek
14th December 2007, 14:43
Following a regular Windows updates rollout the following code began throwing a "user breakpoint" error while running under debug, even though I had no breakpoints set:

QSqlDatabase trdb = QSqlDatabase::addDatabase(DBDRIVER);


This line has been working since the app was created last spring and hasn't been changed. The compiled exe starts and works fine but throws an error when closed. Running under debug the first error occurs when the QOCI attempts to create an environment and the second error occurs when it attempts to close the environment that it couldn't open in the first place. This info I learned because running in debug it breaks on line 1732 of qsql_oci.cpp when the app opens, and on line 1774 when the app closes. The executable only throws an error when the app closes.

Strangely, the app can read and write to the oracle tables without problems. Using debug I determined that the break is exactly at the line highlighted in red. When I put a try - catch around it that line still executes and breaks, but the catch doesn't catch it. :confused:

I am still running 4.3.2 and have not changed either my Oracle Instantclient 10.2 driver or the qsqloci.dll.

Here is most of the main.cpp:


#define DBDRIVER "QOCI"
#define DBHOST "orcdev"
#define DBNAME "orcdevdb"


int main( int argc, char * argv[] ) {
QString lockFileName = QDir::currentPath();
lockFileName.append("/JLK_Lock.txt");
QFile file(lockFileName);
if (file.exists()){
exit(1);
}

QString strRejected = "";
QApplication app(argc, argv);
app.setQuitOnLastWindowClosed(false);
QSqlDatabase trdb = QSqlDatabase::addDatabase(DBDRIVER);
trdb.setHostName(DBHOST);
trdb.setDatabaseName(DBNAME);
trdb.setUserName("jlkreps");
trdb.setPassword("secondla");
if ( trdb.open() ) {
timerecs trec;
trec.show();
app.setQuitOnLastWindowClosed(true);
return app.exec();
} else {
strRejected = QString("Reason: %1").arg(trdb.lastError().text()).toLatin1();
QMessageBox::information(0,"Login Rejected!",strRejected,
QMessageBox::Ok,QMessageBox::NoButton,QMessageBox: :NoButton);
exit(2);
}
}

Anyone else having a problem like this following an MS update roll out, or am I alone?