Probelm connecting to MS Access Database 2007 in Classic ASP

Posted on 2009-05-07
Medium Priority
Last Modified: 2012-05-06
I can connect fine when the database does not have a password set using this code.
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=d:\database\Phase1.accdb"

But when I try adding a password to the database by going to Database Tools, then Encrypt with Password, and then add this line to the code, I can no longer connect to the database.

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=d:\database\Phase1.accdb;Jet OLEDB:Database Password='password';Mode=Share Exclusive"

I get this error.

Error Type:
Microsoft Office Access Database Engine (0x80040E4D)
Not a valid password.
/includes/database.asp, line 5

Please help :)  Thank you.
Question by:okacs
  • 4

Author Comment

ID: 24329965
Note that this works fine with an Access 2003 database in MDB format, but NOT an access 2007 database in ACCDB format.
LVL 10

Assisted Solution

ALaRiva earned 80 total points
ID: 24329997
Remove the single quotes from the password.  


- Anthony

Author Comment

ID: 24330061
Sorry that still did not work for me, same error as before.

Author Comment

ID: 24330244
I found that if I put a space after the colon "Jet OLEDB: Database Password=" I get another error, this error is:

Error Type:
Microsoft Office Access Database Engine (0x80004005)
Could not find installable ISAM.
/includes/database.asp, line 5

Maybe that is the issue?

Accepted Solution

okacs earned 0 total points
ID: 24639405
I was able to find the solution:
This code was correct :
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=d:\database\Phase1.accdb;Jet OLEDB:Database Password=password;"

I was able to find some updates to run to my system, the first being: Download the ODBC and OLEDB Drivers from this website.

Then after that I ran updates on Microsoft Updates and found a few different ones:
a.      Update for Microsoft Access 2007 Help
b.      Update for the 2007 Microsoft Office System Help for Common Features
c.      Update for the 2007 Microsoft System
d.      MS Office Access Runtime and Data Connectivity 2007 Service Pack 2
e.      2007 MS Office Suite Service Pack 2

Updated my system, restarted and everything worked. :)

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
A Case Study of using the Windows API to provide RS232 communications capability in Access without the use of Active-X controls.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

587 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question