ASP Hosting sale!
1,000MB space, 40GB transfer, 1 SQL Server 2000 db! - $9.95 per month*!
Limited Time Offer!

aspdev | articles | tutorials | forums

ASPdev -> SQL & Database Articles -> How to connect to Access 2000 database from ASP

How to connect to Access 2000 database from ASP

Before you can access your MS Access database from ASP, you need to connect to it using one of the following methods:

1. Connect to a Microsoft Access Database using DSN-less connection OLE-DB

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
Server.MapPath("your_database_name.mdb") & ";"
objConn.Close
Set objConn = Nothing


2. Connect to a Microsoft Access Database using DSN-less connection ODBC

Set objConn = Server.CreateObject("ADODB.Connection")
db.objConn "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" &
Server.MapPath("your_database_name.mdb") & ";UID=;PWD="
objConn.Close
Set objConn = Nothing


3. Connect to a Microsoft Access Database using a DSN (To learn how to create system DSN click here)

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DSN=your_dsn_name;UID=;PWD="
objConn.Close




Contact Us