Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeTDS + ODBC

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

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

Hi,

Thanks for the info. I use ODBC without DM because I don't have
unixODBC, iODBC ... on my system. I'm using SunOS 4.1.4 which
is prettey old.

I found my problem already. I add /etc/odbc.ini and all my problems gone !!!
This may be a bug ??? since I used configuration option
--prefix=/usr/local/freetds to build the source code.

The location of freetds.conf is /usr/local/freetds/etc/freetds.conf,
so I expect that the location of odbc.ini should be
/usr/local/freetds/etc/odbc.ini .... BUT IT'S NOT.
I need to use /etc/odbc.ini to make odbc/unittest PASS.


Regards
KC



On 7/27/05, ZIGLIO, Frediano, VF-IT <Frediano.Ziglio AT vodafone.com> wrote:
>
> >
> > 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