Jag får inte till det. Upptäckte att
jag redan kör en counter.. Vet inte
om den ställer till problem..
Koden är här nedan..
<%
mypage = Request("whichpage")
If mypage = "" then
mypage = 1
End If
mypagesize = 50
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 = "FBFFDD"
Else color = "E7E7D6"
End If
%>
<tr bgcolor="<%=color%>"><td><%= rstemp("Datum")%></td><td><%= rstemp("Namn") & " " & rstemp("ENamn")%></td><td align="center"><%= rstemp("Diff")%> s</tr>
<%
rstemp.movenext
howmanyrecs = howmanyrecs + 1
Loop
rstemp.close
Set rstemp = nothing
%>
<tr><td></td><td><hr></td></tr>
<tr><td></td><td><b>
<%
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 >= 50 then
pad = ""
End If
ref = "<b><a href='" & scriptname & "?whichpage=" & counter & "&pagesize=" & mypagesize & "'>" & pad & counter & "</a> "
response.write ref & " "
if counter mod 50 = 0 then
response.write "<br>"
End If
Next
End If
End If
%>