To make a connection to a Microsoft Access database, you can use the following code:

<%
    strProvider = "Provider=Microsoft.Jet.OLEDB.4.0;
                   Data Source=
                   D:/webserver/localuser/username/mdb/mdbmydb.mdb;"
    Set rst = Server.CreateObject("ADODB.recordset")
%>

Afterwards, you can use rst to retrieve the data as follows:

<%
    strQuery = "SELECT * FROM Tabel"
    rst.Open strQuery, strProvider
%>

This data can be processed in the following manner:

<%
     If rst.EOF Then
          Response.Write "No data in database."
     Else
          While not rst.EOF
               For i = 1 To rst.Fields.Count - 1
                    Response.Write rst(i)
               Next
               rst.MoveNext
          Wend
     End If
%>
Kunnen we je nog ergens anders mee helpen?

Bel of mail ons. We helpen je snel met een antwoord.

Contacteer ons