dan.niele
6th June 2012, 16:51
Hello to everyone.
I'm stuck on an error from QSqlDatabase.
I'm modifying a project wrote by other developers.
Last working configuration was VC6 with QT4 library and everything worked, but when I try to port it to Qt creator using QT4 library i got an "unknown error" message from QT.
The error occurs when I try to call QSqlDatabase close method:
DB_MSAccess::DB_getProductInfo()
{
openclose = m_RegisterDB.open(); // openclose return true, so the database is open
m_RegisterDB.close();
}
The QSqlDatabase is initialized in the constructor class and is declared private into header file.
DB_MSAccess::DB_MSAccess()
{
m_RegisterDB= QSqlDatabase::addDatabase("QODBC",MAIN_DB);
m_RegisterDB.setDatabaseName (MAIN_DB);
}
I forget to mention that the error occurs only in DEBUG -step by step mode. If I run the code either in RELEASE or DEBUG the code works perfectly.
Anyone knows how to help me??
Thanks for your help
I'm stuck on an error from QSqlDatabase.
I'm modifying a project wrote by other developers.
Last working configuration was VC6 with QT4 library and everything worked, but when I try to port it to Qt creator using QT4 library i got an "unknown error" message from QT.
The error occurs when I try to call QSqlDatabase close method:
DB_MSAccess::DB_getProductInfo()
{
openclose = m_RegisterDB.open(); // openclose return true, so the database is open
m_RegisterDB.close();
}
The QSqlDatabase is initialized in the constructor class and is declared private into header file.
DB_MSAccess::DB_MSAccess()
{
m_RegisterDB= QSqlDatabase::addDatabase("QODBC",MAIN_DB);
m_RegisterDB.setDatabaseName (MAIN_DB);
}
I forget to mention that the error occurs only in DEBUG -step by step mode. If I run the code either in RELEASE or DEBUG the code works perfectly.
Anyone knows how to help me??
Thanks for your help