[unixODBC-support] [S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source

mandar at webchat.chatsystems.com mandar at webchat.chatsystems.com
Mon Aug 29 15:36:21 BST 2005


Folks,

    Need some assistance - I've tried most things to debug this issue:

--------------------------------------------------------------------
rtcc110:/usr/local/etc # cat odbcinst.ini
[ODBC]
Trace           = Yes
TraceFile       = /tmp/sql.log
ForceTrace      = Yes
Pooling         = No

[TDS]
Description     = FreeTDS
Driver          = /usr/local/lib/libtdsodbc.so
FileUsage       = 1
CPTimeout       = 5
CPReuse         = 5
UsageCount      = 1

[Intranet]
Description     = FreeTDS
Driver          = /usr/local/lib/libtdsodbc.so
FileUsage       = 1
CPTimeout       = 5
CPReuse         = 5
UsageCount      = 1
-------------------------------------------------------------------
rtcc110:/usr/local/etc # cat odbc.ini
[Intranet]
Driver          = Intranet
Port            = 1433
Description     = ODBC connection via FreeTDS
Servername      = Intranet
ServerNode      = myname.mydomain.org
Database        = Intranet

--------------------------------------------------------------------
rtcc110:/usr/local/etc # cat freetds.conf
[global]
         tds version = 8.0
         initial block size = 512

         # 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 level = 10

         # 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.
         # (Microsoft servers sometimes pretend TEXT columns are
         # 4 GB wide!)   If you have this problem, try setting
         # 'text size' to a more reasonable limit
         text size = 64512

[Intranet]
         host = myname.mydomain.org
         port = 1433
         tds version = 8.0

-------------------------------------------------------------
tsql works fine:

rtcc110:/usr/local/etc # tsql -S Intranet -U cfreader -P XXXX
locale is 
"LC_CTYPE=en_US;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=C;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C"
locale charset is "ISO-8859-1"
1> select count(*) from pert_active
2> go

53204
1>

------------------------------------------------------------------
isql fails:

rtcc110:/usr/local/etc # isql -v Intranet cfreader XXXXX
[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[ISQL]ERROR: Could not SQLConnect

cat /tmp/sql.log

[ODBC][26322][__handles.c][444]
                 Exit:[SQL_SUCCESS]
                         Environment = 0x804f6d0
[ODBC][26322][SQLAllocHandle.c][345]
                 Entry:
                         Handle Type = 2
                         Input Handle = 0x804f6d0
[ODBC][26322][SQLAllocHandle.c][463]
                 Exit:[SQL_SUCCESS]
                         Output Handle = 0x804fc80
[ODBC][26322][SQLConnect.c][3549]
                 Entry:
                         Connection = 0x804fc80
                         Server Name = [Intranet][length = 8 (SQL_NTS)]
                         User Name = [cfreader][length = 8 (SQL_NTS)]
                         Authentication = [**********][length = 10 
(SQL_NTS)]
                 UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE 
'UCS-2LE'

                 DIAG [S1000] [FreeTDS][SQL Server]Unable to connect to 
data source

[ODBC][26322][SQLConnect.c][3917]
                 Exit:[SQL_ERROR]
[ODBC][26322][SQLError.c][424]
                 Entry:
                         Connection = 0x804fc80
                         SQLState = 0xbfffe8d0
                         Native = 0xbfffe8c8
                         Message Text = 0xbfffe8e0
                         Buffer Length = 500
                         Text Len Ptr = 0xbfffe8ce
[ODBC][26322][SQLError.c][461]
                 Exit:[SQL_SUCCESS]
                         SQLState = S1000
                         Native = 0xbfffe8c8 -> 0
                         Message Text = [[unixODBC][FreeTDS][SQL 
Server]Unable to connect to data source]
[ODBC][26322][SQLError.c][424]
                 Entry:
                         Connection = 0x804fc80
                         SQLState = 0xbfffe8d0
                         Native = 0xbfffe8c8
                         Message Text = 0xbfffe8e0
                         Buffer Length = 500
                         Text Len Ptr = 0xbfffe8ce
[ODBC][26322][SQLError.c][461]
                 Exit:[SQL_NO_DATA]
[ODBC][26322][SQLError.c][504]
                 Entry:
                         Environment = 0x804f6d0
                         SQLState = 0xbfffe8d0
                         Native = 0xbfffe8c8
                         Message Text = 0xbfffe8e0
                         Buffer Length = 500
                         Text Len Ptr = 0xbfffe8ce
[ODBC][26322][SQLError.c][541]
                 Exit:[SQL_NO_DATA]
[ODBC][26322][SQLFreeHandle.c][268]
                 Entry:
                         Handle Type = 2
                         Input Handle = 0x804fc80
[ODBC][26322][SQLFreeHandle.c][317]
                 Exit:[SQL_SUCCESS]
[ODBC][26322][SQLFreeHandle.c][203]
                 Entry:
                         Handle Type = 1
                         Input Handle = 0x804f6d0

-----------------------------------------------------------

Appreciate your help...thanks

- Mandar



More information about the unixODBC-support mailing list