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:


Qt Code:
  1. DB_MSAccess::DB_getProductInfo()
  2. {
  3. openclose = m_RegisterDB.open(); // openclose return true, so the database is open
  4. m_RegisterDB.close();
  5. }
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.
Qt Code:
  1. DB_MSAccess::DB_MSAccess()
  2.  
  3. {
  4. m_RegisterDB= QSqlDatabase::addDatabase("QODBC",MAIN_DB);
  5. m_RegisterDB.setDatabaseName (MAIN_DB);
  6. }
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