How to view all records in a table
S T E P - 1
- Create an ASP program to get all records and put them into a HTML table.
<%
Set cntMember = Server.CreateObject("ADODB.Connection")
cntMember.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/cyberprogrammer/cp.mdb")
Set rstMember = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM member;"
rstMember.Open strSQL, cntMember, adOpenForwardOnly, adLockReadOnly
Do Until rstMember.EOF 'Perform the looping until the EOF is true
strTable = strTable & "" & rstMember("MemberID") & _
"" & rstMember("Email") & "" & rstMember("Gender") & _
"" & rstMember("Age") & "" & rstMember("Nationality") & _
"" & rstMember("AccessLevel") & "" &_
rstMember("LastLogin") & "" & rstMember("Count") & ""
'Prepare each row in the HTML table
rstMember.MoveNext
loop
rstMember.Close
cntMember.Close
Set rstMember = Nothing
Set cntMember = Nothing
%>
S T E P - 2
- Use the Response to put the codes inside the HTML table:
<% Response.Write strTable %>
No comments:
Post a Comment