PDA

View Full Version : ODBC & FreeTDS qwith Qt 4.7 fails !!



jpujolf
28th October 2010, 13:58
Hi all,

I'm testing to upgrade my Qt 4.6.2 version ( in a Ubuntu machine 64 bits, FreeTDS 0.63 ) to Qt 4.7.

When testing this simple APP, it fails ( working without problems in 4.6.3 version... )


#include <QCoreApplication>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>

int main ( int argc, char *argv[] )
{
QCoreApplication a(argc, argv);

QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
db.setDatabaseName ( "DRIVER=FREETDS;SERVER=EPC;SERVERNAME=SQL-Spanish;DATABASE=CRCDAT");
db.setUserName("sa");
db.setPassword("*****");

if ( db.open() )
{
qDebug ( "CONNECTION WORKED" );
QSqlQuery QRY;
QRY.setForwardOnly(true);
QRY.exec ( "SELECT TOP 10 * FROM SYSOBJECTS" );
if ( QRY.lastError().isValid() )
qDebug ( "Error executing SQL Query : %s", qPrintable ( QRY.lastError().text() ) );
}
else
qDebug ( "CONNECTION FAIL" );

return 0;
}


Says something like
Error executing SQL Query [unixODBC][Driver Manager]Driver does not support this function QODBC3: QODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration

Obviously I've seen it's not an ODBC config problem, it I test the same program linked with Qt 4.6.2 works like a charm...

Can somebody run this simple test program in a similar environment & confirm it's Qt's bug before open a task in bugtracker ? Many thanks