<% 'How many records per page do we want to show? Const iRecordsPerPage = 10 Dim currentPage 'what page are we on?? Dim bolLastPage 'are we on the last page? if len(Request.QueryString("page")) = 0 then currentPage = 1 else currentPage = CInt(Request.QueryString("page")) end if 'Show the paged results strSQL = "sp_PagedItems " & currentPage & "," & iRecordsPerPage objRS.Open strSQL, objConn 'See if we're on the last page if Not objRS.EOF then if CInt(objRS("MoreRecords")) > 0 then bolLastPage = False else bolLastPage = True end if end if %>

<% Do While Not objRS.EOF %> <% objRS.MoveNext Loop %>
List of Items
<%=objRS("Name")%> <%=FormatCurrency(objRS("Price"))%>

<% 'Only show the previous button if we are NOT on the first page if currentPage > 1 then %>       <% end if 'Only show the next button if we are NOT on the last page if Not bolLastPage then %> <% end if %>