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: Tue, 18 Dec 2007 09:16:46 -0700

I did a little more testing and was able to get a (better?) error message:

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

generates the following error:

--------
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(02047E20, xxxxx, 2)
dblib.c:459:dbsetlname(02047E20, xxxxxx, 3)
dblib.c:459:dbsetlname(02047E20, PHP 5, 5)
dblib.c:812:dbopen(02047E20, 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 abc\def.
config.c:446: Reached EOF
config.c:375:Looking for section abc\def.
config.c:432: Found section abc\def.
config.c:435:Got a match.
config.c:456: host = 'abc.adomain.com'
config.c:485:Found host entry abc.adomain.com.
config.c:488:IP addr is 204.xxx.xx.xx.
config.c:456: instance = 'def'
config.c:456: port = '1197'
config.c:456: client charset = 'UTF-8'
config.c:502:tds_config_login: client charset is UTF-8.
config.c:456: tds version = '8.0'
config.c:456: dump file append = 'yes'
config.c:456: dump file = 'C:\Inetpub\wwwroot\freetds.log'
config.c:446: Reached EOF
config.c:251:Success: [abc\def] defined in c:\freetds.conf.
iconv.c:361:iconv to convert client-side data to the "UTF-8" character set
iconv.c:514:tds_iconv_info_init: converting "UTF-8"->"UCS-2LE"
iconv.c:514:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
net.c:819:select: retval 1 err 0
net.c:836:instance info
0000 05 6c 00 53 65 72 76 65-72 4e 61 6d 65 3b 42 4f |.l.Serve rName;ab|
0010 52 3b 49 6e 73 74 61 6e-63 65 4e 61 6d 65 3b 67 |c;Instan ceName;g|
0020 65 6e 3b 49 73 43 6c 75-73 74 65 72 65 64 3b 4e |en;IsClu stered;N|
0030 6f 3b 56 65 72 73 69 6f-6e 3b 38 2e 30 30 2e 31 |o;Versio n;8.00.1|
0040 39 34 3b 74 63 70 3b 31-31 39 37 3b 6e 70 3b 5c |94;tcp;1 197;np;\|
0050 5c 42 4f 52 5c 70 69 70-65 5c 4d 53 53 51 4c 24 |\abc\pip e\MSSQL$|
0060 47 45 4e 5c 73 71 6c 5c-71 75 65 72 79 3b 3b |def\sql\ query;;|

net.c:185:Connecting to 204.228.89.23 port 1197 (TDS version 8.0)
net.c:240:connect(2) returned "Unknown error"
util.c:120:Changing query state from IDLE to DEAD
net.c:310:tds_open_socket() failed
token.c:2217:tds_client_msg: #20009: "Server is unavailable or does not
exist.". Connection state is now 4.
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(02047E20)
--------

I know this wasn't the config setup you had suggested, but it seems to give
a "better" error message than before...





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