I get the below error only when my IDE open. It connects well when it is found closed.
[SqlException (0x80131904): Cannot open user default database. Login failed.
Login failed for user 'JP\ASPNET'.]
I could solve this by giving the logged in windows user to impersonate under IIS window > WEBSITE > ASP.NET tab > EDIT CONFIG > APPLICATION tab
But I wish someone could give me the proper solution.
I almost tried all from giving ASPNET user as a administrator to configuring the same in Express management tool.
Environment: XP pro, VWD and SQL Express
The problem i think is that u-r user that u r using has default database and that dont exist, to correct that u must go in the property of that user in Sql menagment system and set other default databse for that user..
I hope this will help
Sorry for my bad english
||| I believe that when you have the database opened as "user instance" it can not be opened by more than one application, like Visual Studio and SQL Server Management Express, etc.
Hi jpbiznes,
Could you please explain a little more?
where did you get that error message? From VWD or from IIS ? I guess it is from IIS since if you are using VWD accessing database, the account should be the one which you use to run VWD -- in this case the account won't be ASPNET.
I get the below error only when my IDE open.
There is a possibility that if you have attached your database file from one process, you cannot attach it again from another process. Since one physical database file cannot be attached by two different instances (note we use customer instance in sql2005 express). But in that case the error message should look lik: cannot attach database again since database file is currently in use.
Also, I performed a search through internet and find this KB article which may be helpful to you:
SYMPTOMS
loadTOCNode(1, 'symptoms');Each user has a default database. When you connect to computer that is running Microsoft SQL Server, and you do not specify a login database, the default database is used. However, if the default database is unavailable at the time of the connection, you may not be able to connect. Instead, you receive error message 4062 or error message 4064. The text of the error messages is as follows:
Cannot open user default database
CAUSE
loadTOCNode(1, 'cause');The user default database is unavailable at the time of connection. It is possible that the database:
? Is in suspect mode. ? No longer exists. ? Is in single user mode and the only available connection is already being used by someone else or by something else. ? Has been detached. ? Has been set to the RESTRICTED_USER state. ? Is offline. ? Is set to emergency status. ? Does not have the login account mapped to a user or the user has been denied access. Additionally, the login account may be a member of multiple groups and the default database for one of those groups is unavailable at the time of connection. ? Is part of a database mirror.
http://support.microsoft.com/?id=307864
Hope my suggestion helps
No comments:
Post a Comment