Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-14808

QODBC fails to exec ANY SQL sentence with ODBC + FreeTDS ( 4.7.0 version )

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • 4.8.x
    • 4.7.0
    • SQL Support
    • None
    • Ubuntu 9.04, gcc 4.4.1, FreeTDS 0.63, Qt 4.7.0

    Description

      This simple program works OK with Qt 4.6.3 & fails in Qt 4.7.0

      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;
      }
      

      The output error is :

      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 haven't changed anything in configuration, it's 4.6.3 to 4.7.0 change that causes the failure.

      Perhaps some clue about ODBC driver compilation / configuration ? I've compiled it with DEFINES +=Q_ODBC_VERSION_2

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            zhongle honglei zhang
            jpujolf Jordi Pujol Foyo
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes