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
|