Skip to Content.
Sympa Menu

freetds - Re: [freetds] Windows Question

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Windows Question
  • Date: Mon, 16 Apr 2007 09:30:22 +0200

>
> Patrick Corbett wrote:
> > I reference it in my PHP connection string the following
> > way:
> >
> > $host = "server\instance";
> > mssql_connect($host, $user, $pass);
> >
> > So... the question is can I use named instances...?
>
> As stated previously, you can use the "instance" entry in
> freetds.conf.
> That's one way.
>
> I'm pretty sure you can use "instance\servername" with any FreeTDS
> library. I know Frediano added it for ODBC
> (http://www.freetds.org/userguide/odbcconnattr.htm) but istr it works
> everywhere. I don't have a server to test with, but you
> could try bsqldb.
> If it connects, PHP should be able to, too.
>

No, this was implemented directly on ODBC. Current CVS have similar
option for libTDS (see parse_server_name_for_port in src/tds/config.c).

> Take care to escape the '\' character if need be. In your
> example above,
> you use double quotes. The PHP manual
> (http://www.php.net/manual/en/language.types.string.php) says the
> backslash needs to be escaped in double-quoted strings:
>
> $host = "server\\instance";
> mssql_connect($host, $user, $pass);
> or
> $host = 'server\instance';
> mssql_connect($host, $user, $pass);
>
> Tell us how it works out. I might need to add something to the User
> Guide.
>

I think so... however I cannot find specifications even for server:port
syntax... this is a useful extension but not that documented.

freddy77





Archive powered by MHonArc 2.6.24.

Top of Page