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

ODBC Driver Manager Function sequence error (MS SQL Server 2005)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P4: Low
    • None
    • 5.6.0
    • SQL Support
    • None
    • Windows 7. Qt 5.6.0. ODBC. MS SQL Server 2005.

    Description

      When I was trying to read some data from ODBC driver, that configured to link to MS SQL Server 2005, I ran the following code:

      QSqlDatabase db = QSqlDatabase::addDatabase( "QODBC" );
      db.setDatabaseName( "Driver={SQL Server Native Client 11.0};Server=COMPUTER_NAME\\SQLEXPRESS;Database=DATABASE_NAME;" );
      db.open( "user", "password" );
      QSqlQuery q( "SELECT field_name FROM table_name", db );
      q.exec(  );
      

      exec() returns false and there is the following message in output window:

      QODBCResult::exec: Unable to execute statement: " Microsoft ODBC Driver Manager Function sequence error"

      But if I run the following code:

      ...
      QSqlQuery q( db );
      q.exec( "SELECT field_name FROM table_name" );
      

      then everything works as expected

      Attachments

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

        Activity

          People

            mabrand Mark Brand
            borisbn Boris
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes