Any
meaningful connection name will do but the choice of interface
for the connection string is more complicated depending
on whether you are using ADO or ODBC
Here
is a a typical ODBC statement.
<%Dim
Conn, RS
Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
"DRIVER=Microsoft Access Driver (*.mdb);DBQ="
Server.MapPath("/USERNAME/database/mydatabase.mdb")
Conn.Open
ASP applications are fluent ODBC speakers thanks
to a built-in OLE DB/ODBC interpreter. in the Microsoft Data
Access Components (MDAC) 2.7 package on the computer. For example,
suppose you want your application to communicate with a Microsoft
Access database by using an ODBC interface. In ASP, if you specify
only the ODBC interface and no OLE DB interface, by default
the application will use an OLE DB/ODBC interpreter to translate
the OLE DB into ODBC, then it will use the ODBC/Access interpreter
you specified to translate. - courtesy of Dreamweaver
Help |
You
may need to use an ADO (ADODB)and OLE BD connection string.
It depends on what your hosting company supports
Here
is the provider statements for car333.asp
conn.open
"PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" &
strMDBPath
The
connection and recordsets use ADO as below
set
conn=server.createobject("ADODB.Connection")
set rsuser=server.createobject("ADODB.Recordset") |
Sample
Access Database from Webdevonline.co.uk
Honest
Dave's Car Database
- this is the code for an Access database connected via ADODB and displayed
using an ASP processing page. It would need a Windows based server
to display it
Look
at more detailed example of
code for an ASP connection as used in the database
Example
Working Database
Look
at this Access database This is hosted on the Windows server running
this page Honest
Dave