[freetds] odbc connection configuration

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Thu Apr 15 04:12:57 EDT 2004


> 
> Hi list gang - its my first post here, please be gentle:)
> 

Hi Roger!

> I'm using freetds-0.62.3, on solaris 8, connecting to MSSQL 2000.
> 
> I think I may need just a little bit of help getting the ODBC bits 
> of freetds configured properly.
> 
> I have established and verified connectivity from my solaris system
> to my MSSQL server using the freetds tsql utility:)
> 
> I am trying to use freetds without a driver manager, and have 
> configured
> it as specified in the tutorial. That is - I downloaded and 
> unpacked the 
> unixODBC package, and pointed to that destination when 
> configuring freetds,
> like so:
> 
>   --with-odbc-nodbm=/home/rsr/unixODBC-2.2.8
> 

Not the suggested configuration however it should work. Mind that driver
manager does a lot of test before calling ODBC API so some wrong
arguments can lead to strange results.

> 
> Like I say, I have succeeded in building freetds, and have 
> used tsql to
> connect, 
> query, and update my MSSQL database.
> 
> My freetsd.conf file contains this entry 
> 
> [MyServer]
> 	host = isengard
> 	port = 1433
> 	tds version = 8.0
> 
> The problems start with trying to use ODBC.
> I am starting with trying to run the tests in 
> src/odbc/unittests, but am
> failing, apparently not having the right odbc.ini, 
> odbcinst.ini, and/or
> freetds.conf
> files or contents or something.
> 

ODBC driver need a odbc.ini. I don't know where is should reside if you
compiled with --with-odbc-nodbm=/home/rsr/unixODBC-2.2.8 (perhaps in
/home/rsr/unixODBC-2.2.8/etc/odbc.ini ??) however $HOME/.odbc.ini should
work. Another way is to use SQLDriverConnect and a DSN-less
configuration (see http://www.freetds.org/userguide/dsnless.htm) and do
not use DRIVER entry (used only by driver manager).

> My PWD file contains the following
> 
> UID=insight
> PWD=mypassword
> SRV=MyServer
> DB=testdb2
> 

This file is used only for testing purpose.

> 
> For my purposes,  I'd be happy to bypass the various odbc.ini 
> type files,
> and all of the config files and compose and pass a DSN to SQLConnect
> directly, 
> if that is easier, but what should it look like?
> 
> What is/are the proper args to pass to SQLConnect in order to 
> establish a connection given the info above?
> 
> Or, what do I put in which odbi.ini type files to correspond to this?
> 
> Thanks very much for any help, I won't be able to use freetds if I 
> can't get this first bit figured out.
> 
> roger
> 

bye
  freddy77



More information about the FreeTDS mailing list