Jag skulle kunna vilja trycka nextpage på min sida http://www.costodia.com/kompis/index.asp?whichpage=11&pagesize=10
hur skulle en sådan kod kunna se ut?
jag använder denna kod:
<table>
<%
mypage = Request("whichpage")
If mypage = "" then
mypage = 1
End If
mypagesize = 10
SQL = "Select * From tabell Order by fält"
Set rstemp = Server.Createobject("ADODB.Recordset")
rstemp.cursorlocation = 3
rstemp.cachesize = 5
MdbFilePath = Server.MapPath("path/databas.mdb")
rstemp.open SQL, "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"
If rstemp.EOF then
Response.write "Där fanns det ju inget... " & 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
Response.write "<tr bgcolor='" & color & "'><td>" & RStemp("fält") & "</td></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 >= 10 then
pad = ""
End If
ref = "<a href='" & scriptname & "?whichpage=" & counter & "&pagesize=" & mypagesize & "'>" & pad & counter & "</a> "
response.write ref & " "
if counter mod 10 = 0 then
response.write "<br>"
End If
Next
End If
End If
%>
</td></tr>
</table>
------------------
Mvh Martin Persson
www.Costodia.com