freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Steve Langasek <vorlon AT netexpress.net>
- To: TDS Development Group <freetds AT franklin.oit.unc.edu>
- Subject: Re: ODBC and SQL server 7
- Date: Tue, 27 Feb 2001 14:43:46 -0600 (CST)
Hi Claudio,
On Tue, 27 Feb 2001, Claudio Cicali wrote:
> I need just a little hint(s).
> Using 'native' freetds calls (from Linux) I'm able to get data from
> a Sql server. This works fine.
> Now I have to make a step forward: I need ODBC calls.
> I'm porting a win32 application to Linux and I need to mantain
> the current interface it has with the database. It use ODBC.
> Reading the README of freetds, I read that it uses iODBC as the CLI.
> So, I have downloaded the current release of iODBC and carefully
> read the code you provide (./src/odbc/odbc.c).
> What is not clear is:
> Have I to call the iODBC API which then use the tds driver as the
> odbc driver ?
Yes, you would use the iODBC API, and load a DSN that uses the tds driver.
> If this is the case, how can I actually perform this operation ?
> In which way I can instruct iODBC to use the freetds ?
If you are familiar with setting up a DSN under Windows, the procedure
is much the same for Linux. I use unixODBC instead of iODBC, so some things
may be different; but on my server I have a file, /etc/odbcinst.ini, which
lists my drivers in this format:
[Name]
Description = description
Driver = /path/to/odbc-driver.so
Setup = /usr/lib/libodbc<odbctype>.so
FileUsage = 1
<other options>
For instance, the MyODBC entry looks like this:
[MySQL]
Description = ODBC for MySQL
Driver = /usr/local/lib/libmyodbc-2.50.36.so
Setup = /usr/lib/libodbcmyS.so
FileUsage = 1
'Driver' points to the ODBC driver that supports your type of SQL server, and
'Setup' points to a driver that lets you set up DSNs through a graphical
interface (this part would be optional).
Then in /etc/odbc.ini I have my system DSNs, with all the same information you
would have under Windows:
[mysqltest]
Description = myodbc
Driver = MySQL
Trace = No
;Trace = Yes
;TraceFile = /tmp/mysql.log
Server = <host>.netexpress.net
Port = 3306
Socket =
Database = <databasename>
User = <user>
Password = <password>
> There is also a reasonable probability that all this works in
> a production environment ?
I have not (yet) used freetds as an ODBC driver from Linux, so I don't know
how well it works.
HTH,
Steve Langasek
postmodern programmer
-
ODBC and SQL server 7,
Claudio Cicali, 02/27/2001
- <Possible follow-up(s)>
- Re: ODBC and SQL server 7, Steve Langasek, 02/27/2001
Archive powered by MHonArc 2.6.24.