[unixODBC-support] Isql - connecting to SQL Server 2005 named instance

Andy Pflueger AndyPflueger at ivyhill-cinram.com
Fri Jul 18 12:59:12 BST 2008


Hello,

The other day, I posted an issue with setting up unixODBC & freeTDS for
accessing a SQL Server database. In that post, I don't believe I mentioned
that our database is defined in a "named instance" of SQL Server. Tsql works
just fine and I'm able to communicate after setting up freeTDS as follows:

[CIRSTEST]
        host = 172.20.1.192
        instance = cinnetsql_test
        tds version = 8.0

Then, once tsql worked, I proceeded to setup odbc.ini as follows and test
isql connectivity. This results in error.

$ cat odbc.ini
[CIRSTEST]
Driver          = FreeTDS
Description     = ODBC connection via FreeTDS
Trace           = No
Servername      = CIRSTEST
Database        = cinram_it_request_system_test

$ cat odbcinst.ini
[FreeTDS]
Description     = TDS driver (Sybase/MS SQL)
Driver          = /usr/local/lib/libtdsodbc.so
Setup           = /usr/local/lib/libtdsS.so
CPTimeout       =
CPReuse         =
FileUsage       = 1

$ isql CIRSTEST reqsysUser PASSWORD_HERE -v
[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[37000][unixODBC][FreeTDS][SQL Server]Login failed for user 'reqsysUser'.
[ISQL]ERROR: Could not SQLConnect

I am VERY certain I'm using the same password and username spelling when I
use tsql, but isql keeps returning the above error each time. Is there
something special in my odbc.ini or odbcinst.ini I'm missing in order to
connect to a SQL Server named instance? I thought maybe adding "Instance =
INSTANCE_NAME" would help but that hadn't. I've also tried putting the
Server, Port, User, and Password in odbc.ini as well and no luck.

We would like to try and host our application on Linux/Apache but if we
can't get this owrking may have to resort back to setting up IIS for Ruby
support and then use its build-in ADO library which works just fine when
we're on our localhost (Netbeans w/ WEBrick web server).

Thanks again in advance,

Andy Pflueger
Sr System Admin
Ivy Hill - Louisville



More information about the unixODBC-support mailing list