Easy Tutorial
❮ Ado Tutorial Ado Intro ❯

ADO Database Connection


Before accessing data from a web page, you must first establish a database connection.


Creating a DSN-less Database Connection

The simplest way to connect to a database is by using a DSN-less connection. A DSN-less connection can be used for any Microsoft Access database on your site.

Suppose you have a database named "northwind.mdb" located in the "c:/webdata/" web directory, you can use the following ASP code to connect to this database:

Note that in the example above, you must specify the Microsoft Access database driver (Provider) and the physical path of the database on the computer.


Creating an ODBC Database Connection

Suppose you have an ODBC database named "northwind", you can use the following ASP code to connect to this database:

With an ODBC connection, you can connect to any database on any computer in your network as long as the ODBC connection is available.


ODBC Connection to an MS Access Database

Here's how to create a connection to an MS Access database:


ADO Connection Object

The ADO Connection Object is used to create an open connection to a data source. Through this connection, you can access and manipulate the database.

View all methods and properties of this connection object.

❮ Ado Tutorial Ado Intro ❯