problem med pageing...
Hvorfor virker min paging ikke?Her kommer en del af scriptet (håber det er nok)
<% case \"vis\"
\' Hvis der ikke er valgt noget mode vises alle links
\' Paging
intPage = Request(\"page\")
If isNumeric(intPage) = False Or intPage < 1 Then
intPage = 1
End If
\' Database connection
Set rs = Server.CreateObject(\"ADODB.RecordSet\")
strSQL = \"SELECT * FROM links WHERE kategori=\'\" & request(\"kat\") & \"\' AND godkendt=\'ja\' ORDER BY navn\"
strDSN = \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=t:\\.......\"
rs.Open strSQL, strDSN, 1
If Not (rs.BOF Or rs.EOF) Then
rs.PageSize = 10
rs.AbsolutePage = intPage
intRecCount = rs.PageSize
intPageCount = rs.PageCount
Response.Write \"<table width=\'500\' cellspacing=\'2\' cellpadding=\'0\'>\"
Do While Not rs.EOF And intRecCount > 0
Response.Write \"<tr><td valign=top width=\'100%\' colspan=2 bgcolor=#e5e5e5><font size=2><b><a href=links.asp?mode=id&id=\" & rs(\"ID\") & \" target=\'_blank\'>\" & rs(\"Navn\") & \"</a></b></font></td></tr>\"
Response.Write \"<tr><td valign=top width=\'80%\' bgcolor=#efefef><font size=2>\" & rs(\"Beskrivelse\") & \"</font></a></td>\"
Response.Write \"<td valign=top width=\'20%\' bgcolor=#e5e5e5><font size=2> Hits: \" & rs(\"Hits\") & \"</font></td></tr>\"
Response.Write \"<tr><td width=\'100%\' colspan=2 bgcolor=#efefef> </td></tr>\"
intRecCount = intRecCount - 1
rs.MoveNext
Loop
End If
Response.Write \"</table>\"
rs.Close
Set rs = Nothing
\' Navigering mellem siderne med paging
Response.Write \"<table width=\'500\' style=\'border-top: 1 solid #C0C0C0;border-bottom: 1 solid #C0C0C0\'><tr>\"
If Clng(intPage) > 1 Then
Response.Write \"<td><font size=\'2\'><a href=links.asp?page=\" & intPage - 1 & \" class=paging>[<<]</a></td>\"
Else
Response.Write \"<td></td>\"
End If
Response.Write \"\"
For intNum = 1 To intPageCount
Response.Write \"<td valign=\'top\'><font size=\'2\'><a href=links.asp?page=\" & intNum & \">\" & intNum & \"</a></font></td> \"
Next
If Clng(intPage) < Clng(intPageCount) Then
Response.Write \"<td><font size=\'2\'><a href=links.asp?page=\" & intPage + 1 & \" class=paging>[>>]</a></td>\"
Else
Response.Write \"<td></td>\"
End If
Response.write \"<td><font size=\'2\'>Page <b>\" & intPage & \"</b> of \" & intPageCount & \"</font></td><td><p align=\'right\'><font size=\'2\'><a href=\'links.asp\'>Link menu</a> | <a href=\'links.asp?mode=søg\'>Search</a> | <a href=\'links.asp?mode=add\'>Post new link</a></font></p></td></tr></table>\"
case else
\' Database connection
Set rs = Server.CreateObject(\"ADODB.RecordSet\")
strSQL = \"SELECT * FROM kategorier ORDER BY kategori\"
strDSN = \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=t:................\"
rs.Open strSQL, strDSN, 1
If Not (rs.BOF Or rs.EOF) Then
Response.Write \"<table border=\'0\' width=\'100%\'><tr><td width=\'100%\'><b><font size=\'2\'>Parrot Link Nest</font></b> is a link database. You are welcome to "<b><a href=\'http://www.minside.dk/link/links.asp?mode=add\'>Post a new link online</a></b>". You can also "<b><a href=\'http://www.minside.dk/link/links.asp?mode=søg\'>Search</a></b>" the database. </td></tr></table><br><br>\"
Response.Write \"<table width=\'504\' cellspacing=\'2\' cellpadding=\'5\'>\"
Do until rs.EOF = True
Response.Write \"<tr><td width=\'100%\' colspan=2 bgcolor=#ffffff><a href=\'links.asp?mode=vis&kat=\" & rs(\"kategori\") & \"\'>\" & rs(\"kategori\") & \"</a></td></tr>\"
rs.MoveNext
Loop
End If
Response.Write \"</table>\"
rs.Close
Set rs = Nothing
end select %>
</body>
</html>