[freetds] Using FreeTDS ODBC on Windows

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Wed May 3 05:55:32 EDT 2006


> 
> Hi all
>             I have gotten it to work using the 'Connection 
> String' that I
> passed into SqlDriverConnect. Here is the connection string 
> that I used:
> ""Servername=my_server;UID=username;PWD=passwd;TDS_Version=7.0
> " Using this;
> I am able to connect and issue a statement to the sql server. 
> IF I run the
> SQL Profiler on te server: I can see that the server got the 
> statement. For
> some reason though; SQLExecDirect () returns a -1 after I 
> call it. The weird
> thing is that If I use the 'ODBC' configuration; then I am 
> able to pass in
> the same statement and have it be executed correctly.  
> 
> Any tips?
> Thanks
> Nav
> 

Yes, you have to specify driver option like

"Driver=FreeTDS;Servername=my_server;UID=username;PWD=passwd;TDS_Version=7.0"

Note that "FreeTDS" has to be registered as ODBC driver (as installer does). I don't know if Driver=c:\path\whatever\freetds.dll works.

freddy77




More information about the FreeTDS mailing list