asp分页跳转出现错误
分页跳转出现如下错误信息:参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突代码如下:<%page=clng(request("page"))Setrs=Serv...
分页跳转出现如下错误信息:参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突
代码如下:
<%
page=clng(request("page"))
Set rs=Server.CreateObject("ADODB.RecordSet")
if a="教师库" then
sql="select * from en_user order by id desc"
elseif a="学员库" then
sql="select * from in_user order by id desc"
elseif a="音乐艺术库" then
sql="select * from en_user order by id desc"
end if
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
response.Write("暂时没有记录")
else
rs.PageSize=29
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page
for j=1 to rs.PageSize
%>
<tr>
<td height="26" align="center" bgcolor="#F5F5F5" class="bluecolor">9138</td>
<td height="26" align="center" bgcolor="#F5F5F5">华中师范大学</td>
<td height="26" align="center" bgcolor="#F5F5F5">小学教育</td>
<td height="26" align="center" bgcolor="#F5F5F5">大专</td>
<td height="26" align="center" bgcolor="#F5F5F5">英语,语文,文综</td>
<td height="26" align="center" bgcolor="#F5F5F5" class="bluecolor">06-25</td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
%>
<tr valign="bottom">
<td height="50" colspan="6" align="center" >
<%if Page<2 then
response.write "首页 上一页 "
else
response.write "<a href=jyk.asp?page=1>首页</a> "
response.write "<a href=jyk.asp?page=" & Page-1 & ">上一页</a> "
end if
if rs.pagecount-page<1 then
response.write "下一页 尾页"
else
response.write "<a href=jyk.asp?page=" & (page+1) & ">"
response.write "下一页</a> <a href=jyk.asp?page="&rs.pagecount&">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&Page&"</font>/"&rs.pagecount&"</strong>页 "
response.write " 共<b><font color='#FF0000'>"&rs.recordcount&"</font></b>条记录 <b>"&rs.pagesize&"</b>条记录/页"
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
response.write " <input class=input type='submit' value=' Goto ' name='cndok'></span></p>"
%>
</td>
</tr>
<%
end if
rs.close
set rs=nothing
%>
我对分页代码不怎么理解,哪位大虾修改好并能把这个分页代码详细解释一下就给加分哦 展开
代码如下:
<%
page=clng(request("page"))
Set rs=Server.CreateObject("ADODB.RecordSet")
if a="教师库" then
sql="select * from en_user order by id desc"
elseif a="学员库" then
sql="select * from in_user order by id desc"
elseif a="音乐艺术库" then
sql="select * from en_user order by id desc"
end if
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
response.Write("暂时没有记录")
else
rs.PageSize=29
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page
for j=1 to rs.PageSize
%>
<tr>
<td height="26" align="center" bgcolor="#F5F5F5" class="bluecolor">9138</td>
<td height="26" align="center" bgcolor="#F5F5F5">华中师范大学</td>
<td height="26" align="center" bgcolor="#F5F5F5">小学教育</td>
<td height="26" align="center" bgcolor="#F5F5F5">大专</td>
<td height="26" align="center" bgcolor="#F5F5F5">英语,语文,文综</td>
<td height="26" align="center" bgcolor="#F5F5F5" class="bluecolor">06-25</td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
%>
<tr valign="bottom">
<td height="50" colspan="6" align="center" >
<%if Page<2 then
response.write "首页 上一页 "
else
response.write "<a href=jyk.asp?page=1>首页</a> "
response.write "<a href=jyk.asp?page=" & Page-1 & ">上一页</a> "
end if
if rs.pagecount-page<1 then
response.write "下一页 尾页"
else
response.write "<a href=jyk.asp?page=" & (page+1) & ">"
response.write "下一页</a> <a href=jyk.asp?page="&rs.pagecount&">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&Page&"</font>/"&rs.pagecount&"</strong>页 "
response.write " 共<b><font color='#FF0000'>"&rs.recordcount&"</font></b>条记录 <b>"&rs.pagesize&"</b>条记录/页"
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
response.write " <input class=input type='submit' value=' Goto ' name='cndok'></span></p>"
%>
</td>
</tr>
<%
end if
rs.close
set rs=nothing
%>
我对分页代码不怎么理解,哪位大虾修改好并能把这个分页代码详细解释一下就给加分哦 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询