1. Knowledge Base
  2. >
  3. Results
  4. >
  5. Article

Using ADOs to connect to MS Access DB

What is an ADO

ADO stands for ActiveX Data Object. It is a Microsoft Active-X component that is automatically installed with Microsoft IIS (Internet Information Services). The ADO is a programming interface that is used to access data in a database.


Configure an ADO to connect to a MS Access database

To utilize ADO on our platform, please use the following connection string code, which must specify the Microsoft Access database driver (Provider) and the physical path to the database on the computer:
connection string code

In the example above, we connect to the database movies.mdb, and the physical path to this database is: data/movies.mdb


Access a database from an ASP page

The common way to access a database from inside an ASP page is to:

  1. Create an ADO connection to a database.
    • The easiest way to connect to a database is to use a DSN-less connection. A DSN-less connection can be used against any Microsoft Access database on a Website. The connection string must specify the Microsoft Access database driver (Provider) and the physical path to the database on the computer.
  2. Open the database connection.
  3. Create the recordset.
  4. Open the recordset.
  5. Extract the data you need from the recordset.
  6. Close the recordset.
  7. Close the connection.


ASP Code Example

In our environment, the following sample ASP code connects to a Microsoft Access database called movies.mdb and selects and displays the Actors information found in the Actors table.

connection string code
Chat
Close