ODBC login uses default database for login

ODBC login uses default database for login

Post by Chrism » Fri, 30 Apr 1999 04:00:00



We have a 3rd party app that uses ODBC to connect to the server. It offers a
DSN login screen, we select a database name (A), then we're told that it
cannot open database B.

There is no database B on the server. What's happening is this: B used to
exist, the login's default database was set to B, then B was deleted.
syslogins still shows B as the default database.

When we contacted the company, asking them why the connection would not be
using the selected A database, but the default database, they said their
product is not at fault it must be "some setting" on SQL Server. This
doesn't make any sense to me, however. Can anyone shed some light on this?

SQL 6.5 - ODBC 3.x

 
 
 

ODBC login uses default database for login

Post by Neil Pik » Sat, 01 May 1999 04:00:00


Chrismo,

 Can you not amend the syslogins entry?  This is probably a bug specific to
certain ODBC versioins

 Neil Pike MVP/MCSE.  Protech Computing Ltd
 (Please post ALL replies to the newsgroup only unless indicated otherwise)
 For SQL FAQ entries see
 http://go.compuserve.com/sqlserver (library 1) - latest stuff is always here
 www.ntfaq.com/sql.html
 http://www.swynk.com/faq/sql/sqlserverfaq.asp

 
 
 

ODBC login uses default database for login

Post by Chrism » Sat, 01 May 1999 04:00:00


Quote:>  Can you not amend the syslogins entry?  This is probably a bug specific
> to
> certain ODBC versioins

Yeah -  it's easily fixable by simply assigning a valid default database.

My concern is this: why is the connection looking to the default database
instead of the requested database in the DSN? If this is a flaw in the
vendor app - I need to know that. If this is a flaw in the particular ODBC
driver - I need to know that to make sure we don't use that version. We'll
have major problems if all connections are dependent on the login's default
database - not what is set in the DSN.

I guess I need to do some testing to see if there's a particular
sqlsrv32.dll version that this occurs with.

I just have a hard time seeing this being a driver problem since it seems to
me to be such a noticeable error (unless it only chooses the default
database when it doesn't exist, which would be a bit bizarre). My first
suspicion was the application making the ODBC calls.

Obviously I haven't thoroughly tested all this - that's not very helpful -
but it never hurts to ask...

Thanks

Chris

 
 
 

ODBC login uses default database for login

Post by Neil Pik » Sun, 02 May 1999 04:00:00


Chrismo,

 I'd do a SQL trace to see what's being sent, but this is being done at the
driver/dsn level so I can't see that the app could be causing the problem...

 Neil Pike MVP/MCSE.  Protech Computing Ltd
 (Please post ALL replies to the newsgroup only unless indicated otherwise)
 For SQL FAQ entries see
 http://go.compuserve.com/sqlserver (library 1) - latest stuff is always here
 www.ntfaq.com/sql.html
 http://www.swynk.com/faq/sql/sqlserverfaq.asp

 
 
 

ODBC login uses default database for login

Post by Michel Shuqai » Wed, 02 Jun 1999 04:00:00


use sp_defaultdb statement to make database A the default from within isql/w
program

Michel Shuqair