Qt-interest Archive, January 2007
Crash with QODBC driver
Message 1 in thread
Hello guys,
does anyone has the same crash in Qt 4.2.2 when using QSqlDatabase with
QODBC?
I have the following function:
void test()
{
QSqlDatabase db = QSqlDatabase::addDatabase( "QODBC" );
db.setDatabaseName( "mytestdb" );
db.setHostName( "localhost" );
db.setPassword( "" );
db.setUserName( "" );
bool ret = db.open();
}
When the function is finished the destructor of QSqlDatabase gets called
and the program crashes in QODBCDriver::cleanup(). I am connecting
against a Microsoft Access database and mytestdb is registered in the
ODBC settings as "user DSN".
Any ideas?
I have configured Qt 4.2.2 with a MySQL, PostgreSQL, DB2, Interbase,
SQLite and ODBC on Windows XP SP2, Visual Studio .NET 2005.
Regards,
Falko
--
[ signature omitted ]
Message 2 in thread
Hi again,
I have found one workaround to avoid the crash. If I explicitely close
the database at the end of the usage the program does not crash anymore.
This behaviour is only with the ODBC adapter. With MySQL, PostgreSQL and
DB2 I need not to close the database. Qt does the right here when
calling the destructor.
Seems to be a bug...
Regards,
Falko
Am 12.01.2007 23:09, Falko Buttler schrieb:
> Hello guys,
>
> does anyone has the same crash in Qt 4.2.2 when using QSqlDatabase
> with QODBC?
>
> I have the following function:
>
> void test()
> {
> QSqlDatabase db = QSqlDatabase::addDatabase( "QODBC" );
> db.setDatabaseName( "mytestdb" );
> db.setHostName( "localhost" );
> db.setPassword( "" );
> db.setUserName( "" );
> bool ret = db.open();
> }
>
> When the function is finished the destructor of QSqlDatabase gets
> called and the program crashes in QODBCDriver::cleanup(). I am
> connecting against a Microsoft Access database and mytestdb is
> registered in the ODBC settings as "user DSN".
>
> Any ideas?
>
> I have configured Qt 4.2.2 with a MySQL, PostgreSQL, DB2, Interbase,
> SQLite and ODBC on Windows XP SP2, Visual Studio .NET 2005.
>
> Regards,
> Falko
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
--
[ signature omitted ]