Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
dharper_ii
Starting Member
3 Posts |
Posted - 2008-07-01 : 07:13:11
|
Hello All,I have a sudden problem. I have my MS SQL Server 2005 on my local development machine and about 7 DB's on it. Well, I have a .net application that accesses 2 of the DB's. The connection to the first one opens just fine, but I get an error on the second connection when I attempt to open it: "Cannot open database "xyz" requested by the login. The login failed". The really strange thing is that I can connect to the DB's from VS 2005 via the Server Explorer (and yes I made sure that the connection string in the Server Explorer and my code jives), but then it kicks back that error in my try block. The following is the error that is generated in the sql server log:2008-07-01 06:42:55.12 Logon Error: 18456, Severity: 14, State: 16.2008-07-01 06:42:55.12 Logon Login failed for user 'DENNIS-CB848706\Dennis'. [CLIENT: ]Any help or insight on this problem would be greatly appreciated,Dennis |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-07-01 : 07:35:07
|
State 16 means that the user does not have permissions to log into the target database. Are you using trusted connections in server explorer when you can see the database? Is the database online (not marked SUSPECT etc)? |
 |
|
dharper_ii
Starting Member
3 Posts |
Posted - 2008-07-01 : 08:00:46
|
quote: Originally posted by RickD State 16 means that the user does not have permissions to log into the target database. Are you using trusted connections in server explorer when you can see the database? Is the database online (not marked SUSPECT etc)?
Thanks for your reply Rick,To answer your first question, both the Sql Server and VS are both running on my local machine, so yes, I think that I am on a trusted connection. Your second question is where I am a little unsure about. I looked at all of the property values in SQL Manager and I did not see any property marked as SUSPECT. I assume that where I would check to see if the DB is online is under the property of "Status". If that is correct, then the status is marked as normal. Please let me know if I am wrong in that assumption, and/or what other paths I might be able to explore to resolve this problem.Thanks again,Dennis |
 |
|
dharper_ii
Starting Member
3 Posts |
Posted - 2008-07-01 : 08:15:09
|
Thank you for looking, but for some strange reason, it is now working.I apologize for needlessly taking you time.Thanks,Dennis |
 |
|
|
|
|
|
|