Select the search type
  • Site
  • Web
Search
You are here:  Support/Forums
Support

Bring2mind Forums

Cannot open user default database. Login failed.
Last Post 11/15/2011 4:58 PM by Vic. 3 Replies.
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
spbarber
New Member
New Member
Posts:10


--
01/23/2009 12:00 AM

I recently accessed my DOCX 5 database from the SQL management console.  After that I get the following message:

Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

 

I tried detaching from the database and still get the same error.  I've also restarted the web site by touching the web.config file.  When re-attach to the SQL database the data seems fine.  After some research I've found the following link that may apply:

http://msdn.microsoft.com...ibrary/ms229862.aspx

However the wizard explains that removing information about ASP.NET membership, profiles, role management, perosnalization and SQL Web even provider from the database.  Note: This process cannot be undone. 

At this point I am looking to know if I'm headed in the right direction or if I have other options.  We have a fair amount of information in the database so I'm hoping to save what we have.  Any help would be appreciated.  Thank you.

 

 

Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
01/24/2009 11:16 PM
Hi Steve,

I'm not sure where your db is right now in terms of authentication and so on. But know this:

1. Your web application connects to your database with a particular identity. To access the data, the db wants to know who is calling. Your whole DNN installation appears as the same identity and this is set in the connection string in your web.config.
2. The identity DNN uses to access data has nothing to do with the users and roles set up in DNN. These live in the aspnet_ tables and are used by DNN to find out what the user has access to.
3. There should be an overall account that lets you into the database. This is the system administrator, or 'sa', account. Use this to have super access to everything in SQL.
4. The 'sa' can set permissions on a database. Typically the account DNN uses to access the db must have 'owner' privileges on the database used for DNN.
5. From your account above it looks like the account under which DNN accesses the db is NETWORK SERVICE. So it is using the default worker process account. I usually use specific accounts when I set up SQL that I then use in the connection string in the web.config. That way I know how DNN is going to present itself when getting data.

Peter
spbarber
New Member
New Member
Posts:10


--
01/26/2009 3:46 PM

Thanks for your reply Peter.  I restored the database from a backup and am up again.  I will study your reply and believe that an answer is there along with some additional research and TRAINING on my part concerning SQL databases.  I think I can figure out 80% of SQL but it's the 10% I don't know that scares me.  Thanks again.

Vic
New Member
New Member
Posts:1


--
11/15/2011 4:58 PM
Hi,

can you try to unlock the sa account?

alter login sa with password='your sa password' unlock
You are not authorized to post a reply.