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

Lukasz Szybalski szybalski at gmail.com
Wed Jul 16 22:02:20 BST 2008


On Wed, Jul 16, 2008 at 3:50 PM, Andy Pflueger
<AndyPflueger at ivyhill-cinram.com> 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
>
>
> /etc/odbcinst.ini
> ------------------
> [ODBC]
> Trace           = Yes
> TraceFile       = /tmp/sql.log
> ForceTrace      = Yes
> Pooling         = No
>
> [FreeTDS]
> 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"
> Password:
> 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
> usage
> cinram_it_request_system_test   1
> C:\Data\cinram_it_request_system_test\cinram_it_request_system_test.mdf
> PRIMARY 3072 KBUnlimited        1024 KB data only
> cinram_it_request_system_test_log       2
> C:\Data\cinram_it_request_system_test\cinram_it_request_system_test_log.ldf
> 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! :)


What OS are you using?

Have you tried doing something like:
http://wiki.debian.org/Manual-Howto#head-98596f3fc232d9467b36d08c98b29ae62f3c78b1

Lucas



More information about the unixODBC-support mailing list