Skip to Content.
Sympa Menu

freetds - Re: [freetds] Named Instances

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Patrick Corbett" <pcorbe81 AT maine.edu>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Named Instances
  • Date: Mon, 17 Dec 2007 22:24:01 -0700

Thank you for your prompt response, I really appreciate that.

Hmm... I think my issue may be that I don't have the IP (host) name
available... abc.hostname.com does exist, but using that in the host place
doesn't work... The DB is located behind a firewall, so I'm guessing that I
can ONLY use the named instance to connect to the DB. If a "host" is
required... what do you think I could do to convince my DB Admin to allow me
to reference an IP (would they have to open something up to allow this or is
there something more secure they could do to allow me to connect?).

Here is my updated freetds.conf:

----
[def]
host = abc.adomainname.com
instance = def
port = 1433
client charset = UTF-8
tds version = 8.0
;text size = 20971520
dump file append = yes
dump file = C:\Inetpub\wwwroot\freetds.log
----


Error I receive:
-----
dblib.c:3593:dbsetlogintime(5)
dblib.c:3574:dbsettime(60)
dblib.c:413:dblogin(void)
dblib.c:4535:dberrhandle(024D1090)
dblib.c:4553:dbmsghandle(024D10E0)
dblib.c:459:dbsetlname(02047C58, xxxxx, 2)
dblib.c:459:dbsetlname(02047C58, xxxxx, 3)
dblib.c:459:dbsetlname(02047C58, PHP 5, 5)
dblib.c:812:dbopen(02047C58, abc\def, [microsoft])
dblib.c:268:dblib_get_tds_ctx(void)
config.c:166:Getting connection information for [abc\def].
config.c:170:Attempting to read conf files.
config.c:304:... $FREETDSCONF not set. Trying $FREETDS/etc.
config.c:317:... $FREETDS not set. Trying $HOME.
config.c:327:... Error getting ~/.freetds.conf. Trying c:\freetds.conf.
config.c:247:Found conf file 'c:\freetds.conf' (default).
config.c:375:Looking for section global.
config.c:432: Found section gen.
config.c:446: Reached EOF
config.c:375:Looking for section abc\def.
config.c:432: Found section def.
config.c:446: Reached EOF
config.c:253:[abc\def] not found.
config.c:173:Failed in reading conf file. Trying interface files.
config.c:910:Looking for server abc\def....
config.c:947:Looking for server in c:\/interfaces.
config.c:801:Searching interfaces file c:\/interfaces.
config.c:826:Couldn't open c:\\interfaces.
config.c:985:Setting 'ip_port' to 1433 as a guess.
iconv.c:361:iconv to convert client-side data to the "ISO-8859-1" character
set
iconv.c:514:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
login.c:226:IP address pointer is empty
login.c:228:Server abc not found!
dblib.c:1105:dbclose(02047A30)
dblib.c:253:dblib_del_connection(025048A8, 02048230)
mem.c:565:tds_free_all_results()
dblib.c:294:dblib_release_tds_ctx(1)
dblib.c:5426:dbfreebuf(02047A30)
dblib.c:438:dbloginfree(02047C58)
----

Thanks again for any help you could provide!

- Patrick

On 12/17/07, James K. Lowden <jklowden AT freetds.org> wrote:
>
> 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
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>




Archive powered by MHonArc 2.6.24.

Top of Page