CFF KB - Carrz-Fox-Fire Promotions Knowledge Base
CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.Knowledge Base
- Breadrumbs:
Microsoft OLE DB Provider for SQL Server error '80004005' Cannot open database
- Article ID:
164 - Date Created
Wednesday, January 18, 2012 - Last Updated
Wednesday, June 20, 2012 - This Article Has been Viewed
5562 times - Short Desc
When connecting your ASP Classic or ASP.NET script to a SQL Server database, you may receive the following error, if the database does not exist. - Details
When connecting to SQL Server through ASP Classic or ASP.NET, and the database that is defined in the Connection script, does not exist, you will receive the following error.Microsoft OLE DB Provider for SQL Server error '80004005'
Cannot open database "ask" requested by the login. The login failed.
/ACN.asp, line 32 - Recreate Issue
To recreate this issue.
Using the following SQL Server ASP Classic connection script, to connect to a database that does not exist.<%
Set askConn = CreateObject("ADODB.Connection")
askConn.ConnectionString = "Provider=SQLOLEDB;Data Source=SERVER\INSTANCE_NAME;Database=MyDat;User ID=USERNAME;Password=********;"
askConn.Open
%>
The database name is: MyDat
This database, does not exist in SQL Server. - Resolve Issue
To resolve this issue.
Using the following SQL Server ASP Classic connection script, to connect to a database that does exist.<%
Set askConn = CreateObject("ADODB.Connection")
askConn.ConnectionString = "Provider=SQLOLEDB;Data Source=SERVER\INSTANCE_NAME;Database=MyData;User ID=USERNAME;Password=********;"
askConn.Open
%>
The database name is: MyData
This database, does exist in SQL Server, and a connection is made.
Make sure that you have the name of the database spelled correctly.
(or)
Make sure that you have attached the database if you are migrating to another system.
Share With Friends (Updated 6-8-2010)
Recent Articles
All Topics
- Coming Soon - Knowledge Exchange
Trending Articles
- Microsoft VBScript runtime error '800a0046' Permission denied FileSystemObject 24695
- Microsoft OLE DB Provider for SQL Server error '80040e57' String or binary data would be truncated. or The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data. 21297
- ADODB.Parameters error '800a0e7c' Parameter object is improperly defined 19545
- After Effects warning: Audio conforming failed for the following file .cfa. Perhaps due to disk space 17785
- The backup set holds a backup of a database other than the existing 16826