VIEW GUESTBOOK


<% pagetot = 5 const adOpenForwardOnly = 0 const adOpenKeySet = 1 const adOpenDynamic = 2 const adOpenStatic = 3 const adLockReadOnly = 1 const adLockPessimistic = 2 const adLockOptimistic = 3 const adLockBatchOptimistic = 4 Set rsGuestbook = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT tblComments.Name, tblComments.Comments, tblComments.date FROM tblComments ORDER BY tblComments.date DESC;" rsGuestbook.Open strSQL, adoCon, adopenkeyset, adlockoptimistic If request("begin") = "" Then begin = 1 Else begin = Cint(request("begin")) End If tot = ((begin + pagetot) -1 ) If tot > rsGuestbook.RecordCount Then tot = rsGuestbook.RecordCount End If i = 1 navi = "" For j = 1 to rsGuestbook.RecordCount step pagetot If j <> 1 Then navi = navi & " | " If j = Cint(begin) Then navi = navi & ""&i&"" Else navi = navi & "" navi = navi & i & "" End If i = i + 1 Next i = 1 rsGuestbook.Move begin - 1 %>

<% For x = begin to begin + (pagetot - 1) If rsGuestbook.EOF Then exit For %> <% i = i + 1 rsGuestbook.MoveNext Next %>
<% Response.Write "Name: " & (rsGuestbook("Name")) %> <% Response.Write "Date: " & (rsGuestbook("date")) %>
<% Response.Write "Comments: " & (rsGuestbook("Comments")) %>
Records <%=begin%> - <%=tot%> of <%=rsGuestbook.RecordCount%> Page : <%=navi%>
<% rsGuestbook.Close Set rsGuestbook = Nothing Set adoCon = Nothing %>

 

 

Click here to go back to the homepage