[unixODBC-support] unixODBC - isql not working with MSSQL

Nick Gorham nick.gorham at easysoft.com
Wed Jul 16 23:12:00 BST 2008


Andy Pflueger wrote:

>Hello,
>
>I've been fighting with configuring unixODBC all day today and not getting
>anywhere. Ultimately, we would like to use Ruby's DBI:ODBC library but until
>then need to get 'isql' so it'll connect to my data source. Here's some
>config files and resulting error when I attempt to connect with isql; please
>not that tsql connects just fine to my database using the same credentials
>and I'm able to execute SQL statements.
>
>Database type: MS SQL Server
>
>
>/etc/odbc.ini
>--------------
>[CIRSTESTDB]
>Driver          = /usr/local/lib/libtdsodbc.so
>Description     = ODBC connection via FreeTDS
>Servername      = CIRSTEST
>TDS_Version     = 5.0
>Database        = cinram_it_request_system_test
>
>
>/usr/local/etc/freetds.conf
>----------------------------
>#   $Id: freetds.conf,v 1.12 2007/12/25 06:02:36 jklowden Exp $
>#
># This file is installed by FreeTDS if no file by the same
># name is found in the installation directory.
>#
># For information about the layout of this file and its settings,
># see the freetds.conf manpage "man freetds.conf".
>
># Global settings are overridden by those in a database
># server specific section
>[global]
>        # TDS protocol version
>;       tds version = 4.2
>
>        # Whether to write a TDSDUMP file for diagnostic purposes
>        # (setting this to /tmp is insecure on a multi-user system)
>        dump file = /tmp/freetds.log
>        debug flags = 0xffff
>
>        # Command and connection timeouts
>        timeout = 10
>        connect timeout = 10
>
>        # If you get out-of-memory errors, it may mean that your client
>        # is trying to allocate a huge buffer for a TEXT field.
>        # Try setting 'text size' to a more reasonable limit
>        text size = 64512
>
># Cinram test sqlserver 2000
>[CIRSTEST]
>        host = ip_of_test_server
>        instance = cinnetsql_test
>        port = 1433
>        tds version = 8.0
>
># Chris Koerner SQLEXPRESS server
>[CIRSDEV]
>        host = ip_of_dev_server
>        instance = SQLEXPRESS
>        port = 1433
>        tds version = 8.0
>
>  
>
Well, its finding the driver. Things to check are is freetds using the 
odbcinst lib to read the ini file or doing it itself. Maybe worth 
setting ODBCINI to point to your odbc.iui file, or use strace to see 
what ini is being opened after the driver lib is loaded.

-- 
Nick



More information about the unixODBC-support mailing list