The steps involved to display records from a database are as follows:-
Step 1 : Open a connection to the database
DIM CONNECT,SQL
SET CONNECT=SERVER.CreateObject("ADODB.CONNECTION")
STR="PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & SERVER.MapPath("customerdata.MDB") (NOTE: customerdata.mdb is the name of the access database)
CONNECT.Open STR
Step 2: create a recordset
DIM RECORD
SET RECORD=SERVER.CreateObject("ADODB.RECORDSET")
RECORD.Open "member",CONNECT,2,3
%>
Step 3:- Retrieving records from the table and displaying them
ID | NAME | ADDRESS |
---|---|---|
<%Response.Write RECORD("MEMBERID")%> | <%= RECORD("MEMBERNAME")%> | <%= RECORD("ADDRESS")%> |