[freetds] FreeTDS and ODBC

Michal Seliga michal.seliga at visicom.sk
Tue Nov 24 09:21:49 EST 2009


hi

i already searched on google and mail archive, i didn't found anything
relevant, only this thread
http://lists.ibiblio.org/pipermail/freetds/2009q4/025334.html
which didn't came into any solution too...

problem:

i can connect to server using tsql using commandline:  tsql -S mssql -U
hamSFA -P hampass
when i use TDSDUMPCONFIG=stdout or strace i see that .freetds.conf in my
home was read and used

then i create odbc files
.odbcinst.ini:
[ODBC Drivers]
TDS = Installed

[TDS]
Driver = /usr/lib/odbc/libtdsodbc.so
Setup  = /usr/lib/odbc/libtdsS.so

 .odbc.ini:

[ODBC Data Sources]
mssql=TDS

[mssql]
Description=mssql
Driver=TDS
ServerName=mssql
Trace=No
TraceFile=/home/test/odbc.trace

[ODBC]
Trace = 1
TraceFile = /home/test/odbctrace_$S.log
Debug = 1
DebugFile = /home/test/odbcdebug_$S.log



they seem to be valid for me, but now when i try to run iodbctest it fails:

$ TDSDUMPCONFIG=stdout TDSDUMP=stdout iodbctest 'DSN=mssql;UID=HamSFA'

iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.0607.1008
log.c:190:Starting log file for FreeTDS 0.82
    on 2009-11-24 15:12:15 with debug flags 0x4fff.
iconv.c:197:names for ISO-8859-1: ISO-8859-1
iconv.c:197:names for UTF-8: UTF-8
iconv.c:197:names for UCS-2LE: UCS-2LE
iconv.c:197:names for UCS-2BE: UCS-2BE
iconv.c:363:iconv to convert client-side data to the "UTF-8" character set
iconv.c:516:tds_iconv_info_init: converting "UTF-8"->"UCS-2LE"
login.c:405:IP address pointer is empty
login.c:407:Server SYBASE not found!
mem.c:563:tds_free_all_results()
error.c:609:SQLGetDiagRec(2, 0x965ba48, 1, 0xbf928e4d, 0xbf928c48,
0xbf928c4d, 512, (nil))
error.c:510:_SQLGetDiagRec(2, 0x965ba48, 1, 0xbf928e4d, 0xbf928c48,
0xbf928c4d, 512, (nil))
1: SQLDriverConnect = [FreeTDS][SQL Server]Unable to connect to data
source (0) SQLSTATE=08001
error.c:609:SQLGetDiagRec(2, 0x965ba48, 2, 0xbf928e4d, 0xbf928c48,
0xbf928c4d, 512, (nil))
error.c:510:_SQLGetDiagRec(2, 0x965ba48, 2, 0xbf928e4d, 0xbf928c48,
0xbf928c4d, 512, (nil))
error.c:609:SQLGetDiagRec(2, 0x965ba48, 1, 0xbf9296bd, 0xbf9294b8,
0xbf9294bd, 512, (nil))
error.c:510:_SQLGetDiagRec(2, 0x965ba48, 1, 0xbf9296bd, 0xbf9294b8,
0xbf9294bd, 512, (nil))
1: ODBC_Connect = [FreeTDS][SQL Server]Unable to connect to data source
(0) SQLSTATE=08001
error.c:609:SQLGetDiagRec(2, 0x965ba48, 2, 0xbf9296bd, 0xbf9294b8,
0xbf9294bd, 512, (nil))
error.c:510:_SQLGetDiagRec(2, 0x965ba48, 2, 0xbf9296bd, 0xbf9294b8,
0xbf9294bd, 512, (nil))
odbc.c:3680:SQLFreeHandle(2, 0x0x965ba48)
odbc.c:3706:_SQLFreeConnect(0x965ba48)
odbc.c:3680:SQLFreeHandle(1, 0x0x965b9e0)
odbc.c:3744:_SQLFreeEnv(0x965b9e0)

in log you can see that instead of server specified in ServerName it
looked for server SYBASE, and no .freedts.conf was loaded (no config
options were written)
connection failed, because such server really doesn't exist

i checked with strace, none of freedts.con(in /etc/freedts/freedts.conf,
or in home) was read or used. according to strace there wasn't even any
try to open it

i tried to set env variable to point to config, but itmade no difference:
echo $FREETDSCONF
/etc/freetds/freetds.conf

iodbc and freedts came from repository of Ubuntu 9.10 32bit and they are
in versions:
iodbc: 3.52.6-3ubuntu1
freetds: 0.82-6

so question is, what is wrong? is it problem in my configuration or
something else?





More information about the FreeTDS mailing list