|
 |
| |
|
|
<%
Dim rst
dim DatabasePath
Dim ado_OpenKeyset
Dim ado_LockOptimistic
Dim strConnect
Dim strSQL
Dim kayitno
'Connection String
DatabasePath = "db/guestbook.mdb"
set strConnect = server.createobject("ADODB.Connection")
strConnect.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ= " & server.mappath(DatabasePath)
'I am using this sql instead of the usual recordset object to sort data in desc order
strSQL = "SELECT * FROM tblContacts " & _
"where type=1"
'Execute the SQL statement'
set rst = strConnect.execute(strSQL) 'this creates our recordset
kayitno = 0
%>
<%
'loop through the table
do while not rst.EOF
kayitno=kayitno+1
%>
| |
|
<%Response.write kayitno & " - " %>
<%Response.write rst("Comments")%>
|
| |
| Name: |
<%Response.write rst("FirstName")%> |
| City: |
<%Response.write rst("LastName") %> |
| <%
if rst("Phone")<>"none" then
Response.write "Web Site: "
Response.write ""& rst("Phone")&", "
end if
if rst("Email")<>"none" then
Response.write "Email: "
Response.write ""& rst("Email")&", "
end if
Response.write "Date Entered: "& rst("DateEntered")
%> |
|
<%
rst.MoveNext
loop
'clean up
rst.Close
set rst = Nothing
%>
|
|
|
|
| |
|
|