Solved

Probelm connecting to MS Access Database 2007 in Classic ASP

Posted on 2009-05-07
5
949 Views
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.
0
Comment
Question by:okacs
  • 4
5 Comments
 

Author Comment

by:okacs
Comment Utility
Note that this works fine with an Access 2003 database in MDB format, but NOT an access 2007 database in ACCDB format.
0
 
LVL 10

Assisted Solution

by:ALaRiva
ALaRiva earned 20 total points
Comment Utility
Remove the single quotes from the password.  

Password=abcdef

HTH
- Anthony
0
 

Author Comment

by:okacs
Comment Utility
Sorry that still did not work for me, same error as before.
0
 

Author Comment

by:okacs
Comment Utility
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?
0
 

Accepted Solution

by:
okacs earned 0 total points
Comment Utility
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.
http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en

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. :)
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now