SQL Error 4060, SQL State 1

SQL Error 4060, SQL State 1

Post by Chris Houg » Sun, 18 Jan 2009 14:11:32


Hi,

My client has a W2003 Server with Sql 2000 SP4 running. There is a security
group defined on the W2003 Server that has all the logins that can access
the application database.

I installed SQL Express 2005 on a client computer which is a member of the
W2003 domain.

My .NET application connects fine to databases on SQL 2000 instance on W2003
Server.

My problem is I fail to connect to the database on the workstation running
the 2005 Express. The security group defined on the W2003 Server shows up
from the SQL 2005 Management studio, and I used the same stored procedure to
grant all rights necessary to that group on the database on the 2005
Express, but everytime I try and connect from my application, I get the same
error, 4060 State 1.

Is there a checklist anywhere which helps diagnose this problem?

Any help is much appreciated.

Chris Hough
 
 
 

SQL Error 4060, SQL State 1

Post by Erland Som » Mon, 19 Jan 2009 01:22:33

Chris Hough ( XXXX@XXXXX.COM ) writes:

Error 4060 is "Cannot open database "%.*ls" requested by the login. The
login failed."

This would indicate that the database you are trying to connect to does
not exist, or that the login you are using to not map to a user in that
database.

So the first thing would be to check that you have spelled the database
name correctly. It can be a good idea to change the connection to use "sa"
or somesuch for the test, just to exclude that you are not victim to a
blindness that happen to everyone.

Once that been done, you need to examine the credentials a little closer.
If I understand you correctly, you have granted database access to a
Windows group, and you are using integrated security. But did you also
grant access to SQL Server to this group? The login might be able to
enter SQL Server by some other group belonging.

Run SELECTs on sys.server_principals and sys.databases_principals in the
troublesome database.
--
Erland Sommarskog, SQL Server MVP, XXXX@XXXXX.COM

Links for SQL Server Books Online:
SQL 2008: http://www.yqcomputer.com/
SQL 2005: http://www.yqcomputer.com/
SQL 2000: http://www.yqcomputer.com/

 
 
 

SQL Error 4060, SQL State 1

Post by bass_playe » Tue, 20 Jan 2009 06:36:09

And since you've mentioned SQL Server Express, did you enable TCP/IP remote
connections?