Probably the most common connection procedure is to set up a ODBC Data Source
and Dataset Name (DSN). If this facility is provided, it can be used to connect
to almost any of the popular database systems for which an ODBC driver is available.
However on many Microsoft Servers, an alternative "DSN-less" connection protocol
is offered based OLE DB.
The important statements which implement the connection are Server.CreateObject(), oConn.Open() & oConn.Execute(). See the ASP script example below. This uses VBscript ie the same Visual Basic script employed in standalone MS Access applications but with additional ADO data access statements .
Contacts within the Authors Database:
<% Dim oConn Dim oRs Dim filePath Dim Index ' Map authors database to physical path filePath = Server.MapPath("./../../incl/auth.mdb") ' Create ADO Connection Component to connect with sample database Set oConn = Server.CreateObject("ADODB.Connection") oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath ' Execute a SQL query and store the results ' within recordset Set oRs = oConn.Execute("SELECT * From authors") %>