You have to bare in mind that you have to have that database located on the Server. Here is a sample of how to connect to an Access database using ASP:
Code:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="My ASP Sample">
</HEAD>
<BODY>
<%
Dim cn
Dim rs
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=d:\wwwroot\PhoneDirectory\PhoneDir.mdb;"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select FirstName, LastName, Phone From Listing", cn, adOpenStatic
Dim i
Response.Write "<center><TABLE border='1'>"
Response.Write "<TR>"
Response.Write "<TD><B>First Name</TD>"
Response.Write "<TD><B>Last Name</TD>"
Response.Write "<TD><B>Phone Extention</TD>"
Response.Write "</TR>"
Do Until rs.EOF
Response.Write "<TR>"
For i = 0 To rs.Fields.Count - 1
Response.Write "<TD>" & rs(i) & "</TD>"
Next
Response.Write "</TR>"
rs.MoveNext
Loop
Response.Write "</TABLE></center>"
%>
</BODY>
</HTML>
In this small sample I'm using the PhoneList database where I'm trying to get all people to be shown in a table.
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819