Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeTDS + ODBC

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "KC" <kcc1967 AT gmail.com>, "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] FreeTDS + ODBC
  • Date: Wed, 27 Jul 2005 10:56:22 +0200


>
> Hi,
>
> I have freetds-0.63 on Linux connect to MS SQL Server 2000.
> I have all configure setup correctly and unittest for tds,dblib,ctlib
> and odbc are ALL PASSed
> (for ODBC, I use --with-odbc-nodm)
>
> And now, I need a static only ODBC driver ... so I add an option
> to configure, "--enable-shared=no".
>
> Everything still working fine except that the ODBC now FAIL
> with following error:
>
> odbctest
> --------
>
> connection parameters:
> server: 'MyServer2k'
> user: 'samples'
> password: 'samples123'
> database: 'tempdb'
> Unable to open data source (ret=-1)
> SQL error S1000 -- [FreeTDS][SQL Server]Unable to connect to
> data source
>
>
> I didn't change anything !!! It's work fine if shared
> library is enabed !!!
> I don't have odbc.ini, just have freetds.conf at
> /usr/local/freetds/etc.
>
> Do I really need odbc.ini. All examples and doc I found show me that
> in odbc.ini, I need a "Driver" which is a ".so" library ...
> but now I only use
> static library and NO so in my build.
> Do I still need odbc.ini ? How can I setup "Driver" in odbc.ini
> if I don't have shared library ?
>
>
> Thanks
> KC
>

No, odbc.ini is not required. We do not recommend the use of library
without DM (driver manager, unixodbc/iodbc/whichever), however someone
use it in this way. You have to link your program to libtdsodbc.a
directly, not libodbc.so, so in linker options you should change -lodbc
with -ltdsodbc. The idea is to call SQLConnect/SQLDriverConnect directly
from driver (that do not use "Driver" entry in odbc.ini). With
SQLDriverConnect you can avoid even freetds.conf.

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page