[freetds] Sybase ASA 7, unixODBC problem
ZIGLIO, Frediano, VF-IT
Frediano.Ziglio at vodafone.com
Mon Nov 8 03:27:17 EST 2004
> > When I was digging through the code...
> > You can set the environment variable DSQUERY to the server
> name and that
> > will be used by tds_set_server
> Well, I'll be.
> I can't say that this has much to recommend it (apart from
> the fact that
> it works, if by accident). We really ought to pick up the
> servername from
> the freetds.conf file. Or maybe from odbc.ini or the
> connection string.
> But at least it's a workaround.
> Thanks for the legwork, Lorne.
I don't like DSQUERY/TDSQUERY method (not threadsafe). Some extracts
from an old mail I found:
L J Bayuk:
> James K. Lowden wrote:
> > > while the server name is part of the "app
> > > name" specification of the sybase_connect() function of PHP. I
> > > think such an option exists for SQSH/TSQL, but perhaps it would be
> > > beneficial to include it?
> > Maybe. I just spent a little while looking for where we pick up the
> > servername and send it to the server (as app_name or the database
> > I didn't find it. I would be nice to rid FreeTDS of this particular
> > if we can.
> Another consequence of this quirk is that it isn't possible to
> FreeTDS to allow connections to two same-named ASA databases on
> servers. Nor can I configure two connections to the same server and
> database but with different options, like one with debug logging and
> What seems to be needed is a freetds.conf parameter called "database
> which can be set independent of what the user guide calls "dataserver
> name". Then you could have different "dataserver names" in
> which send the same database name field in the TDS login packet.
James K. Lowden:
> So, Ben, just so I'm sure I understand: For a connection to ASA to
> the [servername] entry of freetds.conf has to match the server's
> name. The server evidently compares the server_name field of the TDS
> login packet to its database name, and rejects the login if they don't
> match. The "app_name" field doesn't affect your ability to log in.
> You'd like an override. You'd like to control the value of the
> field in the freetds.conf entry, in some way besides the [servername]
> We'll have to invent a reasonable name for it. I think "database
> misleading unless we also send a "use <databasename>" command
> after logging on. I think "servername" is confusing. Perhaps "ASA
> Servername" is better.
> Nes pas?
Checking ODBC code I saw that server_name was not set up correctly.
Fixed in CVS. However ASA problem still remains...
Can an ASA server have multiple databases ? Is this "ASA Servername"
something like Microsoft server "instance" ?
I know I can configure multiple server using different ports on the same
Someone to fix the problem used Server and Address in ODBC DSN however
Address was mean to specify network address (like "184.108.40.206" for ipv4)
not dns name. Also adding instance syntax (SERVER\instance) it's not
Why does ASA use server name in login packet in a different way from ASE
More information about the FreeTDS