<table>
<%
mypage = Request("whichpage")
If mypage = "" then
mypage = 1
End If
mypagesize = 40
SQL = "Select * From Res Order by Diff, ENamn"
Set rstemp = Server.Createobject("ADODB.Recordset")
rstemp.cursorlocation = 3
rstemp.cachesize = 5
MdbFilePath = Server.MapPath("resultat.mdb")
rstemp.open SQL, "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"
If rstemp.EOF then
Response.write "Inga träffar vid sökning av ordet " & sok
Else
rstemp.movefirst
rstemp.pagesize = mypagesize
maxcount = Cint(rstemp.pagecount)
rstemp.absolutepage = mypage
howmanyrecs = 0
howmanyfields = rstemp.fields.count -1
Do While Not RStemp.EOF AND howmanyrecs > rstemp.pagesize
counter = counter + 1
If counter mod 2 = 0 then
color = "CCCC99"
Else color = "CCCC66"
End If
%>< br> <tr bgcolor="<%=color%>"><td><%= rstemp("Datum")%></td><td><%= rstemp("Namn") & " " & rstemp("ENamn")%></td><td><%= rstemp("Diff")%></tr>
<%
rstemp.movenext
howmanyrecs = howmanyrecs + 1
Loop
rstemp.close
Set rstemp = nothing
%>
<tr><td><hr></td></tr>
<tr><td>
<%
If maxcount <> 0 then
response.write "sida " & mypage & " av " & maxcount & "<br>" & sidor:
pad = "0"
scriptname = request.Servervariables("script_name")
for counter = 1 to maxcount
If counter >= 40 then
pad = ""
End If
ref = "<a href='" & scriptname & "?whichpage=" & counter & "&pagesize=" & mypagesize & "'>" & pad & counter & "</a> "
response.write ref & " "
if counter mod 40 = 0 then
response.write "<br>"
End If
Next
End If
End If
%>
</td></tr>
</table>