ASP cannot open encrypted Access 2007 database file via ODBC



To reproduce the issue:

1.        Install “2007 Office System Driver: Data Connectivity Components” in order to open the new Access 2007 .accdb database file.


2.        Place an .accdb Access 2007 database file on server.

The database is password encrypted.


3.        Setup an ODBC system DSN and point it to the .accdb database file.

Enter the database password in advanced options dialog box.


4.        Open the database in ASP page


dim cn

set cn=server.createobject("adodb.connection") "dsn=dsn1"


This error message occurs:

Error 0x80004005 “Not a valid password”



However similar .vbs code works.

dim cn

set cn=createobject("adodb.connection") "dsn=dsn1"

And ASP works if the database is not encrypted.


In order to let it work, you must apply “Microsoft Office Access Runtime and Data Connectivity 2007 Service Pack 2 (SP2)” first.


And then grant read/write permission to .accdb database file and .laccdb lock file to the IIS anonymous user account.

NOTE: Access is not recommended for server environment, for better performance and scalability, please using SQL server instead.

Best Regards,

Juntao Zhu

Comments (1)

  1. Garry Trinder says:

    For more about why Access is not recommended for web applications, you can check this post,

Skip to main content