Results 1 to 7 of 7

Thread: SQL Anywhere ODBC

  1. #1
    Join Date
    Jan 2006
    Location
    France
    Posts
    36
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default SQL Anywhere ODBC

    Hi,

    I'm having trouble with query.value(i).toString() where query is a QQuery

    - unixODBC on Ubuntu
    - Qt 4.5.2

    The error message is:

    qGetStringData: Error while fetching data ( "[Sybase][ODBC Driver]Invalid string or buffer length" )

    The code runs fine when using the native OCI driver, but with SQL Anywhere I need to pass via ODBC.

    Anybody ran across this?
    Derick Schoonbee

  2. #2
    Join Date
    Apr 2007
    Location
    Sunny Darwin, NT Australia
    Posts
    186
    Thanks
    29
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: SQL Anywhere ODBC

    I've a similar message:
    Qt Code:
    1. qGetStringData: Error while fetching data
    To copy to clipboard, switch view to plain text mode 
    The message repeats for every column of the QSqlQuery.
    The line that causes this for me is:
    Qt Code:
    1. QSqlRecord rec = aSqlQuery->record()
    To copy to clipboard, switch view to plain text mode 
    The database driver db2 and it only happens when the function is called a second or third time,
    but it doesn't seem to be a problem as everything seems to work ok.
    I traced it back to the source file qsql_db2.cpp and it's a result of a call to SQLGetData() but I can't find the source file for this.
    Last edited by vieraci; 13th December 2009 at 15:10. Reason: updated contents

  3. #3
    Join Date
    Sep 2009
    Location
    Tashkent, Uzbekistan
    Posts
    107
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: SQL Anywhere ODBC

    Hi, I'm using ODBC to MSSQL. In fact the stuff like Sybase. If you do it under Linux I suggest you to switch to FreeTDS. It works much better and faster than ODBC and supports Sybase data tabular streams.

    Cheers,
    -- tanuki

  4. #4
    Join Date
    Jan 2006
    Location
    France
    Posts
    36
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: SQL Anywhere ODBC

    I've ran the same code on Windows, and I do not have this issue.
    Derick Schoonbee

  5. #5
    Join Date
    Jan 2006
    Location
    France
    Posts
    36
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: SQL Anywhere ODBC

    Quote Originally Posted by Tanuki-no Torigava View Post
    Hi, I'm using ODBC to MSSQL. In fact the stuff like Sybase. If you do it under Linux I suggest you to switch to FreeTDS. It works much better and faster than ODBC and supports Sybase data tabular streams.

    Cheers,
    -- tanuki
    I have a v9 .db / .dbf file that I need to access. I've looked at some settings in the freetds.conf file and did a quick scan of the document but could not find a way to do it.

    Does anyone have an idea on how to do that?

    Thanks!
    D.
    Derick Schoonbee

  6. #6
    Join Date
    Sep 2009
    Location
    Tashkent, Uzbekistan
    Posts
    107
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: SQL Anywhere ODBC

    You can look here for a good MS SQL example. Sybase should go the same way.

    Regards,
    -- tanuki

  7. #7
    Join Date
    Dec 2009
    Location
    Brisbane
    Posts
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: SQL Anywhere ODBC

    I really don't recommend FreeTDS, 0.82 has issues with unicode strings, and the TDS guys are working with us to get their ODBC support top notch.
    If you have a simple example application that fails, definitely, post a bug over at http://bugreports.qt.nokia.com

    ODBC string retrieval code had a bug fixed for 4.6.0, so maybe try that, and it may start working again for you.

Similar Threads

  1. Frustrated with ODBC
    By darkadept in forum Qt Programming
    Replies: 3
    Last Post: 8th December 2011, 03:31
  2. SQL Drivers Distribution
    By kandalf in forum Installation and Deployment
    Replies: 1
    Last Post: 12th January 2009, 09:17
  3. Poor performance with Qt 4.3 and Microsoft SQL Server
    By Korgen in forum Qt Programming
    Replies: 2
    Last Post: 23rd November 2007, 10:28
  4. SQL Insert using ODBC ?
    By allensr in forum Qt Programming
    Replies: 0
    Last Post: 26th July 2007, 00:25
  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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.