Results 1 to 4 of 4

Thread: Frustrated with ODBC

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Posts
    70
    Thanks
    12
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Frustrated with ODBC

    I'm trying to develop an app for Windows using the QODBC driver to connect to Microsoft SQL Server. I'm using mingw to compile. I am doing a lot of my actual development under Linux with Mysql but then I want to port my application to run on windows.

    I'm using basic Qt classes to connect to the database, QSqlTableModel, QSqlQuery, QTableView, and QDataWidgetMapper. I'm doing nothing fancy and it works perfectly with Mysql.

    But it seems like only a small subset of classes that actually work with ODBC. I initially tried to use QSqlQuery using the bind values method and that fails.
    Using table views and table models seem to work but now that I'm trying to use QDataWidgetMapper I get a ton of errors about being "unable to bind variable".

    [edit] The actual error i'm getting (when QDataWidgetMapper tries to save the data to the database is:
    QODBCResult::exec: unable to bind variable: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented

    Is anyone actually using Microsoft Sql Server via ODBC on Windows with any success?
    Last edited by darkadept; 1st April 2008 at 15:54.

  2. #2
    Join Date
    May 2006
    Posts
    70
    Thanks
    12
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Frustrated with ODBC

    Ok... at least i finally found some direction now.

    I turned on ODBC tracing and found this error:
    Qt Code:
    1. mydb 62c-630 EXIT SQLBindParameter with return code -1 (SQL_ERROR)
    2. HSTMT 05223A20
    3. UWORD 8
    4. SWORD 1 <SQL_PARAM_INPUT>
    5. SWORD 9 <SQL_C_DATE>
    6. SWORD 9 <SQL_DATE>
    7. SQLULEN 0
    8. SWORD 0
    9. PTR 0x06394428
    10. SQLLEN 0
    11. SQLLEN * 0x00000000
    12.  
    13. DIAG [S1C00] [Microsoft][ODBC SQL Server Driver]Optional feature not implemented (0)
    To copy to clipboard, switch view to plain text mode 

    This led me to this thread:
    http://www.mydatabasesupport.com/for...plemented.html
    where it talks about specific date values not being able to bind. Specifically DATE and TIME. DATETIME should work though, I think.

    Does anyone have any further input on how to correct this or work around this error?

  3. #3
    Join Date
    Aug 2008
    Posts
    38
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Frustrated with ODBC

    I am curious if this has ever been resolved? I am running into exactly the same issue and not really finding any help...
    Thanks,
    AlphaWolfXV

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Frustrated with ODBC

    If your code tries to do things with SQL or data types that are not supported by the underlying RDBMS or ODBC driver, neither of which is part of Qt, then you can expect it to fail. Darkadept implies that the issue was with data types. Since neither of you have told us exactly what you are doing there is little help to be offered.

Similar Threads

  1. remote ODBC data source
    By mchara in forum Qt Programming
    Replies: 7
    Last Post: 10th December 2007, 10:39
  2. Deploying debug Qt application - failed to load ODBC driver
    By sureshbabu in forum Installation and Deployment
    Replies: 1
    Last Post: 1st November 2007, 12:35
  3. Fun with ODBC and Oracle
    By KaptainKarl in forum Installation and Deployment
    Replies: 4
    Last Post: 27th July 2007, 21:42
  4. Connecting to an ODBC Data Source
    By kikapu in forum Newbie
    Replies: 9
    Last Post: 25th June 2007, 12:18
  5. Can't install Qt4.1 with SQL Support for ODBC in Windows XP
    By danieltruchsess in forum Installation and Deployment
    Replies: 1
    Last Post: 5th February 2006, 10:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.