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

Andy Pflueger AndyPflueger at ivyhill-cinram.com
Wed Jul 16 21:50:47 BST 2008


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

Driver          = /usr/local/lib/libtdsodbc.so
Description     = ODBC connection via FreeTDS
Servername      = CIRSTEST
TDS_Version     = 5.0
Database        = cinram_it_request_system_test

#   $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
        # 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
        host = ip_of_test_server
        instance = cinnetsql_test
        port = 1433
        tds version = 8.0

# Chris Koerner SQLEXPRESS server
        host = ip_of_dev_server
        instance = SQLEXPRESS
        port = 1433
        tds version = 8.0

Trace           = Yes
TraceFile       = /tmp/sql.log
ForceTrace      = Yes
Pooling         = No

Description     = TDS driver (Sybase/MS SQL)
Driver          = /usr/local/lib/libtdsodbc.so
Setup           = /usr/lib/libtdsS.so
CPTimeout       =
CPReuse         =
FileUsage       = 1

Notice isql doesn't work...

$ isql CIRSTESTDB sqldbuser password -v
[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[08S01][unixODBC][FreeTDS][SQL Server]Unable to connect: Adaptive Server is
unavailable or does not exist
[ISQL]ERROR: Could not SQLConnect

Notice tsql works...

tsql -S CIRSTEST -U reqsysUser
locale is "en_US.UTF-8"
locale charset is "UTF-8"
1> exec sp_helpdb cinram_it_request_system_test
2> go
name    db_size owner   dbid    created status  compatibility_level
cinram_it_request_system_test         4.00 MB   CINNETSQLTEST\Administrator
17      Jun 12 2008     Status=ONLINE, Updateability=READ_WRITE,
UserAccess=MULTI_USER, Recovery=FULL, Version=611,
Collation=Latin1_General_CI_AI, SQLSortOrder=0, IsAutoCreateStatistics,
IsAutoUpdateStatistics      90
(1 row affected)

name    fileid  filename        filegroup       size    maxsize growth
cinram_it_request_system_test   1
PRIMARY 3072 KBUnlimited        1024 KB data only
cinram_it_request_system_test_log       2
NULL     1024 KB 2147483648 KB   10%     log only
(2 rows affected)
(return status = 0)

Thanks in advance for any help anyone can provide me - I'm going to go
insane! :)

Andy Pflueger
Sr System Admin
Ivy Hill - Louisville
andypflueger at ivyhill-cinram.com

More information about the unixODBC-support mailing list