% ' Copyright © 2001 Axon Search, Inc.
mypage=request("whichpage")
If mypage="" then
mypage=1
end if
mypagesize=request("pagesize")
If mypagesize="" then
mypagesize=15
end if
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath("fpdb/resultsindex.mdb")
mySQL = "Select * FROM tblIndex"
objConn.Open
Dim rstemp
Set rstemp = Server.CreateObject("ADODB.Recordset")
rstemp.open mySQL, objConn, adOpenKeySet
Response.Write "" & rstemp.RecordCount & "" & " matches were found."
Response.Write "
"
'Do While Not rstemp.EOF
rstemp.pagesize=mypagesize
maxpages=cint(rstemp.pagecount)
maxrecs=cint(rstemp.pagesize)
rstemp.absolutepage=mypage
howmanyrecs=0
howmanyfields=rstemp.fields.count -1
response.write "You are on page " & mypage & " of " & maxpages & "
"
DO UNTIL rstemp.eof OR howmanyrecs >= maxrecs%>
| ">
<%Response.Write rstemp("Title")%> <%Response.Write rstemp("Description")%> |
| "
response.write ""
if (mypage mod 10) = 0 then
counterstart = mypage - 9
else
counterstart = mypage - (mypage mod 10) + 1
end if
counterend = counterstart + 9
if counterend > maxpages then counterend = maxpages
if counterstart <> 1 then
ref="First : "
Response.Write ref
ref="Previous "
Response.Write ref
end if
Response.Write "["
for counter=counterstart to counterend
If counter>=10 then
pad=""
end if
if cstr(counter) <> mypage then
ref="" & pad & counter & ""
else
ref="" & pad & counter & ""
end if
response.write ref
if counter <> counterend then response.write " "
next
Response.Write "]"
if counterend <> maxpages then
ref=" Next"
Response.Write ref
ref=" : Last"
Response.Write ref
end if
response.write " " response.write " | "
response.write "