[unixODBC-dev] Re: FreeTDS Digest, Vol 22, Issue 19

Alf C Stockton alf at stockton.co.za
Fri Nov 12 20:33:44 GMT 2004

  From: "Lowden, James K" <LowdenJK at bernstein.com>
  Subject: RE: [freetds] freetds-0.62.3 & unixODBC-2.2.8
>> I am having a problem understanding how to incorporate freetds into
> unixODBC and
>> as I have a sample C program that is failing to connect to MS SQL on a
> remote
>> server I am a little lost.
> First install unixODBC, then build and install FreeTDS.  Then link your
> C program with those libraries.
> Where exactly are you having difficulty?
What should the DNS look like when I am trying to connect from my C application 
on Linux with MS SQL database Jack2 table jackpot_register on server K9Pad ?

I am also having a problem understanding the relationship between unixODBC & 
freetds. I thought that freetds was a driver that had to be built into unixODBC 
but from what you say these are two seperate libraries and are only "joined" 
when linked into the program.

I compile with gcc odbc.c -o odbc -lodbc -ltds
& then run the program
alf at puppypad:~/dev$ odbc
About to SQLConnect()
Error SQLConnect -1
[unixODBC][Driver Manager]Data source name not found, and no default driver 
specified (0)

The "About to SQLConnect()" is from a printf in my program.


Alf Stockton	www.stockton.co.za

"Dying is a very dull, dreary affair.  And my advice to you is to have
nothing whatever to do with it."
 		-- W. Somerset Maugham

More information about the unixODBC-dev mailing list