Skip to Content.
Sympa Menu

freetds - Re: [freetds] Named Instances

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Named Instances
  • Date: Mon, 17 Dec 2007 23:52:15 -0500

Patrick Corbett wrote:
> I have a setup of SQL Server 2000 on IIS/2003 Server. I'd like to
> connect to the database using the FreeTDS driver, but I am having
> trouble connecting to my database using a named instance. Is it possible
> to connect via a named instance?
...
> My current freetds.conf file looks like:
>
> ------
> [abc\def]
> host = 204.228.89.23:1433
> instance = abc\def
> port = 1433

You want somthing more like this:

[def]
host = abc
instance = def
port = 1433
client charset = UTF-8
tds version = 8.0

The freetds.conf lines are just name-value pairs. They're not parsed.
When you say your host is "204.228.89.23:1433", the library calls
config.c::tds_lookup_host(). That first tries to convert it to an IP
address, and fails (because :1433 isn't part of the address) and then
hands it verbatim to gethostbyname(3). It responds with HOST_NOT_FOUND
because there's no machine with that *name*....

The backslash and :port syntaxes are for command lines and parseable
strings such as ODBC uses.

HTH.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page