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();
}
DB_MSAccess::DB_getProductInfo()
{
openclose = m_RegisterDB.open(); // openclose return true, so the database is open
m_RegisterDB.close();
}
To copy to clipboard, switch view to plain text mode
The QSqlDatabase is initialized in the constructor class and is declared private into header file.
DB_MSAccess::DB_MSAccess()
{
m_RegisterDB.setDatabaseName (MAIN_DB);
}
DB_MSAccess::DB_MSAccess()
{
m_RegisterDB= QSqlDatabase::addDatabase("QODBC",MAIN_DB);
m_RegisterDB.setDatabaseName (MAIN_DB);
}
To copy to clipboard, switch view to plain text mode
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
Bookmarks