Skip to Content.
Sympa Menu

freetds - [freetds] DSN-less

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS <freetds AT lists.ibiblio.org>
  • Subject: [freetds] DSN-less
  • Date: Sun, 14 Dec 2003 10:37:49 -0000

Somethings about DSN-less:

The first way to connect with ODBC was SQLConnect(DSN, UID, PWD), where
DSN = DSN (Data Source Name) name, UID = user id (username), PWD =
password. So you had to configure a DSN in odbc.ini. No others way was
possible.

After a while (ODBC3) they introduce a new function: SQLDriverConnect.
This function use a unique string to specify multiple attributes... So
you can specify how many attributes. You can specify old ones (DSN, UID
and PWD) or any value that driver accept. You can also specify the
driver you want to use. In such way you can even specify all attribute
you use in odbc.ini so you haven't to compile odbc.ini, just use the
connection string. In such way you don't have to configure a DSN, so you
use a DSN-less configuration.

FreeTDS way. FreeTDS wants to replace original proprietary libraries:
dblib and ctlib. So they use an interface file for configuration.
However interface file was not very good so somebody introduced
freetds.conf file. After a while somebody start to write ODBC driver so
the first way to configure ODBC was to use freetds.conf. As of version
0.60 many attributes was introduced and ODBC start to have a better
implementation. With server, port and tds_version attributes you can
specify the server avoiding the use of freetds.conf. On the other way we
introduced SQLDriverConnect implementation so you can specify all
attributes you want inside connection string. In such way you can
specify attribute for odbc.ini and attributes for freetds.conf. So you
can use whatever combination you want. You can decide to use odbc.ini or
not and freetds.conf or not just using different attributes... Just some
attributes are the keys to distinguish between freetds.conf or not and
odbc.ini or not. These attributes are:
- SERVERNAME: it specify freetds.conf entry so if you specify such
attribute you need to configure freetds.conf. You can replace such
attribute with SERVER attribute, this points to the real server.
- DSN and Driver. You can decide to use a DSN entry in odbc.ini using
DSN attribute or specify the driver you wants with Driver attribute.
Note that you can specify attributes or directly in SQLDriverConnect or
in odbc.ini. Using DSN attribute is like to add all odbc.ini entry
attributes inside you connection command...

freddy77





  • [freetds] DSN-less, Frediano Ziglio, 12/14/2003

Archive powered by MHonArc 2.6.24.

Top of Page