Results 1 to 2 of 2

Thread: Microsoft SQL Server Connectivity from Mac

  1. #1
    Join Date
    Jan 2011
    Posts
    8
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Microsoft SQL Server Connectivity from Mac

    I have been reading up on SQL support in Qt. I know that the QTDS driver is considered obsolete now and that the recommended approach is to use QODBC. This is alright if your application only targets Windows, but what are you supposed to do if you want your application to support Mac and Linux? I know there is unixODBC, but that is not very ideal. The last thing I would want to do is have my users install darwinports, unixODBC, then have to walk them through configuring it for their machines. I am also aware of a couple of paid third-party ODBC drivers for the Mac, but those are proprietary and you have to pay for them.

    TDS is still supported on Microsoft SQL servers, even with 2008, so why is the QTDS driver being removed? What other cross-platform options are there to connect to a Microsoft SQL server from Qt? Thanks.

  2. #2
    Join Date
    Jul 2006
    Location
    Catalunya - Spain
    Posts
    117
    Thanks
    16
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Microsoft SQL Server Connectivity from Mac

    I know it's too late to answer, but I've been fighting with that exact configuration last week and I can tell you what you have to do. You MUST use ODBC to access SQL Server ( from UNIX/LINUX, MAC or Window$ )

    - In MAC, install macports and through this, freedts & iodbc ( perhaps you can use the one from OpenLink, but I've uninstalled it... )

    You can configure odbinst.ini like this :

    [SQL Server]
    Description = FreeTDS Driver
    Driver = <path_to_lib>/libtdsodbc.so
    Setup = <path_to_lib>/libtdsodbc.so

    and you can configure freetds.conf like this :

    [global]
    ...

    [SQLServer]
    tds version = 8.0
    client charset = UTF-8

    For the connectionString, you must use one like this:

    "DRIVER=FreeTDS;SERVER=<ip_or_server_name>;UID=<yo ur_uid>;PWD=<...>;SERVERNAME=SQLServer

    Don't forget to set in ODBC's connection options "SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC3"

    Currently I've found that you must add this when you connect to SQL Server from MAC.
    Perhaps last version of FreeTDS 0.82 needs this or perhaps it's my Qt's ODBC driver, I don't know...

    ..and all must work !!

Similar Threads

  1. Accessing Microsoft SQL server 2005
    By yuvarajragupathi in forum Qt Programming
    Replies: 1
    Last Post: 28th October 2010, 13:20
  2. 3rd party native Microsoft SQL Server drivers
    By scarleton in forum Newbie
    Replies: 0
    Last Post: 21st September 2010, 00:58
  3. Replies: 2
    Last Post: 2nd June 2010, 12:19
  4. Poor performance with Qt 4.3 and Microsoft SQL Server
    By Korgen in forum Qt Programming
    Replies: 2
    Last Post: 23rd November 2007, 11:28
  5. Database Connectivity
    By yesraaj in forum Newbie
    Replies: 4
    Last Post: 21st February 2007, 14:58

Tags for this Thread

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.