Skip to Content.
Sympa Menu

freetds - Re: [freetds] Attempting to connect to MS SQL

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Patrick Dunnigan" <patrick.dunnigan AT centivia.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Attempting to connect to MS SQL
  • Date: Tue, 22 Feb 2005 21:30:45 -0500

To be honest, it's been a while since I used the freeTDS, DBD:ODBC setup. Following is my old config, so this may help or not. However, I do know that the freeTDS, DBD:Sybase setup works very well. I benchmarked a couple of years ago and made the switch (basically cut the unixODBC and DBD:ODBC out). It connects faster and for highend transactional performance seems to be faster. Plus there is one less piece of software to setup and you can go DSN'less if you want.

'course, there's probably a reason you went with ODBC on unix, so here's my old config.

Good Luck,
Patrick


odbc.ini ->

[mydb]
Driver = TDS
Servername = 10.1.x.x
PORT = 1433
Database = userid
UID = password

odbcinst.ini ->

[TDS]
Driver = /usr/local/lib/libtdsodbc.so

freetds.conf ->

[mydb]
host = 10.1.2.58
port = 1433






----- Original Message ----- From: "Jamie Lawrence" <freetds-lists-ibilio-org AT jal.org>
To: <freetds AT lists.ibiblio.org>
Sent: Tuesday, February 22, 2005 6:41 PM
Subject: [freetds] Attempting to connect to MS SQL



Hi folks,

I've tried searching the archives, so far to no avail.

I'm attempting to connect to a SQL Server 2K machine via FreeTDS, for an
Apache/mod_perl/DBD::ODBC app from a Debian/Stable machine.

My first attempt was with the .deb for FreeTDS, which is quite old:

$Id: tds.h.in,v 1.9 2001/12/03 00:06:14 brianb Exp $

After setting up, I could only connect through ODBC (isql) if I had a
$HOME/.odbc.ini config file - it appears to ignore /etc/odbc.ini . So,
it would work interactively, but a local config isn't an option for my
application ($ENV{HOME} is not defined).

So, I built from source (FreeTDS-stable as of last Friday), and have
been playing with that version since then, and cannot connect at all.

My odbc.ini uses (currently) this entry (I'm attempting to go the "ODBC
Only" route described in the online docs):

[testdsn]
Description = Test sql server config
Driver = /usr/local/freetds/lib/libtdsodbc.so
Servername = xxx.xxx.xxx.xxx
UID = xxx
PWD = xxx
Port = 1433
Database = test
TDS_Version = 4.2

(I've tried it with TDS_Version set to 7.0 and 8.0 as well; 4.2 is
what the really old libraries I tried first were using for a successful
interactive connect.)

Out of Isql, i get

$ isql -v testdsn xxx xxx
[unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[ISQL]ERROR: Could not SQLConnect


Setting logging on, the operative errors seem to be;

18:05:56.409119 IP address pointer is NULL
18:05:56.409265 Server SYBASE not found!

From a looks of a couple of messages in the archives, it appears that
this indicates that the DSN is not being picked up, or perhaps it is
falling back to looking for a default server 'SYBASE'.

Is that accurate? None of my {odbc.ini, odbcinst.ini, freetds.conf} have a
definition for that name.

I must admit to still being mildly confused as to the role of the
freetds.conf file when attempting an ODBC only config, and have been
trying various combinations of params scattered there, too, but if
anyone could whack me with a cluestick, I'd be much obliged.

For reference, a DSN that worked with the really old libs is:

[dsnold]
Description = minimal working version
Driver = FreeTDS
Servername = xxx.xxx.xxx.xxx
UID = xxx
PWD = xxx
Port =
Database = test

With the odbcinst.ini entry:

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

Thanks in advance,

-j

_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds







Archive powered by MHonArc 2.6.24.

Top of Page