Skip to Content.
Sympa Menu

freetds - Re: [freetds] TDS just 'died'

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] TDS just 'died'
  • Date: Tue, 9 Jun 2009 22:13:41 -0400

O'Neil, Donald A. wrote:
> Our DB admin detached the DB from the MSSQL server, ran a backup and the
> re-attached the DB, and ever since he did that we're getting errors on
> our FreeTDS scripts:
...
> Cannot open user default database
...
> Login failed for user 'NOCReader'
...
> Anyone have any ideas as to what could have happened on the SQL side of
> things to break this?

No idea, except that it's a server issue, because those messages came from
the server.

Logins are defined by the server, not a database. However, that "cannot
open user default database" message says the user is no longer defined or
allowed in the database.

If the 'change to initial database must succeed' flag is set in the login
packet (cf. http://www.freetds.org/tds.html#login7) the server will
disconnect if the database is unavailable to the user.

And it is set on:

$ grep -n option_flag1 src/tds/login.c
702: unsigned char option_flag1 = 0x00;
797: option_flag1 |= 0x80; /* enable warning messages if SET LANGUAGE
issued */
798: option_flag1 |= 0x40; /* change to initial database must succeed
*/
799: option_flag1 |= 0x20; /* enable warning messages if USE
<database> issued */
801: tds_put_byte(tds, option_flag1);


HTH.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page