Next link
hey thereI have an asp page that takes results from my data base, and if there are more than 5 items then it make a \"next 5 links\" link
however when I click on the next link I get a \"page can not be shown error\" :(
so if anyone has a good idea please :)
I would also like to try have my results show as 2 columes instead of one :)
here the script
<html>
<body>
<% Response.Buffer = True
intPage = Request(\"page\")
If isNumeric(intPage) = False Or intPage < 1 Then
intPage = 1
End If
Set rs = Server.CreateObject(\"ADODB.RecordSet\")
strSQL = \"select \" & Request.Form(\"alpha\") & \" from abc\"
strDSN = \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\"&Server.MapPath(\"popup.mdb\")
rs.Open strSQL, strDSN, 1
If Not (rs.BOF Or rs.EOF) Then
rs.PageSize = 5
rs.AbsolutePage = intPage
intRecCount = rs.PageSize
intPageCount = rs.PageCount
%>
<table class=\"border\" width=\"300\" align=\"center\" valign=\"top\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\">
<tr><td class=\"one\"><table>
<%
Do While Not rs.EOF And intRecCount > 0
%>
<tr>
<td>
<%=rs(0)%>
</td>
</tr>
<%
intRecCount = intRecCount - 1
rs.MoveNext
Loop
End If
rs.Close
Set rs = Nothing
%>
</table>
<br>
<div align=\"center\">
<%
If Clng(intPage) < Clng(intRecCount) Then
%>
<a href=\"wordinfo.asp?page=<%=intPage - 1%>\"><< Last 2</a>
<%
Else
%>
<< Last 2
<%
End If
%>
-
<%
If Clng(intPage) < Clng(intPageCount) Then
%>
<a href=\"wordinfo.asp?page=<%=intPage + 1%>\">Next 2 >></a>
<%
Else
%>
Next 2 >>
<%
End If
%>
</div>
</body>
</html>
thanks
Guzzie
