Skip to Content.
Sympa Menu

freetds - Re: [freetds] ODBC connection attributes

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] ODBC connection attributes
  • Date: Sun, 07 Dec 2003 13:17:04 -0000

Il dom, 2003-12-07 alle 08:10, James K. Lowden ha scritto:
> http://www.schemamania.org/projects/freetds/build/doc/userguide/odbc.htm#ODBCCONNATTR
>
> "Use DSN. FreeTDS will search odbc.ini for entry. It lets you specify a
> connection like SQLConnect, but using SSQLDriverConnect. Do not use
> Servername and DSN together. Can be specified only in a connection string,
> not in odbc.ini."
>
> I'm updating the ODBC documentation, and I have a question about the
> above: What does it mean?
>
> "Use DSN. FreeTDS will search odbc.ini for entry." ??
>
> I think it means: if you specify a Data Source Name in your connection
> string, the FreeTDS ODBC driver will look in odbc.ini to figure out the
> servername. I don't understand SQLConnect and SSQLDriverConnect, or why
> Servername conflicts with DSN.
>
> Could someone offer clearer text?
>

DSN is Data Source Name, that name of odbc.ini entry.

There are two way in ODBC to make a connection: SQLConnect and
SQLDriverConnect. SQLConnect 3 fixed attributes (DSN, PWD and UID) while
SQLDriverConnect require a connection string where you can specify how
many attributes you want just with string like
"DSN=mydsn;UID=myusername;PWD=mypassword;WHATEVER=xxxx". So if you use
DSN attribute in SQLDriverConnect connection string you can specify a
connection in a way similar to SQLConnect.

Why you can't use both DSN and Servername? You have 3 connection method:
- DSN-less. You don't use odbc.ini file. You need to use
SQLDriverConnect without DSN attribute.
- ODBC-only. You do not use Servername in odbc.ini so FreeTDS do not
read freetds.conf, all configuration stuff is contained in odbc.ini. You
have to specify DSN in SQLDriverConnect (required in SQLConnect)
- freetds.conf configuration. Use Servername attribute in odbc.ini DSN
or in SQLDriverConnect. The servername refer to entry in freetds.conf,
not real server name.

If you use a DSN a server configuration (server or servername entry)
need to be present in DSN, so you can't use both DSN attribute and
Servername.

Note: PWD and UID are used in all configurations type, not only DSN-less
("Can be specified only for a DSN-less connection" is wrong in PWD and
UID attributes), perhaps confusion came from use of SQLDriverConnect and
DSN-less.

Mm... I'm getting a bit confused too :)

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page