SQL Server 2008 R2 Express Error: Cannot open the PersonnelPro database requested at login. Login Error

I am using SQL Server 2008 R2 Express and the "SQL Server and Windows Authentication" mode in my database. I can open the database using Enterprise Manager, but when I run the aspx application, I get:

Cannot open the PersonnelPro database requested at login. Login failed.

My connection string is web.config:

<add name="dbString" connectionString="Provider=sqloledb;Data Source=AREA51\SQLEXPRESS;Initial Catalog=PersonnelPro;User Id= ****;Password= ****" />` 

I searched the Internet and SO, but could not find a solution. Any ideas that might cause this problem?

Update:
Looking into the SQL log files ("C: \ Program Files \ Microsoft SQL Server \ MSSQL10_50.SQLEXPRESS \ MSSQL \ Log"), I find this:

 2012-12-21 05:58:00.97 Logon Error: 18456, Severity: 14, State: 38. 2012-12-21 05:58:00.97 Logon Login failed for user 'PersonnelPro'. Reason: Failed to open the explicitly specified database. [CLIENT: <named pipe>] 

This web application is owned by a third-party company. So technically, I only need to configure the web.config file, and it should work.

+6
source share
1 answer

Remove the space after the '=' sign for user ID and password. I think this is interpreted as part of the value.

Update:

The new error message you sent (failed to open the explicit database.) Can mean one of two things:

  • A database with this name does not exist or is written with an error.
  • The user with whom you are trying to log in does not have access to the database. You can verify this by running exec sp_helpuser 'username' in the database.
+2
source

All Articles