紧急求助!我为什么不能翻页?
<%
const MaxPerPage=30
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim keyword
keyword=trim(request("keyword"))
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<form method="post" action="searchbybanjianhao_USER_TYPE_ACCESS.asp" name=addbt3>
<table width="60%" border="0">
<tr>
<td width="44%">
按业务角色查询:<input class=TextBorder name=keyword >
</td>
</tr>
</table>
</form>
<div align="center"> <%
dim sql
dim rs
sql="select * from USER_TYPE_ACCESS where type='"&keyword&"' "
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,cnn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'> 还 没 有 任 何 资 料 !</p>"
else
totalPut=rs.recordcount
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpages
showContent
showpages
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpages
showContent
showpages
else
currentPage=1
showpages
showContent
showpages
end if
end if
rs.close
end if
set rs=nothing
cnn.close
set cnn=nothing
sub showContent
dim i
i=0
%>
<%do while not rs.eof%>
<td ><%=rs("type")%>
</td>
<td >
<%=rs("ACCESS_NAME")%>
</td>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
<%
end sub
sub showpages()
dim n
if (totalPut mod MaxPerPage)=0 then
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if
dim k
response.write "分页 "
for k=1 to n
if k=currentPage then
response.write "[<b>"+Cstr(k)+"</b>] "
else
response.write "[<b>"+"<a href='searchbybanjianhao_USER_TYPE_ACCESS.asp?page="+cstr(k)+"&type="&keyword&"'>"+Cstr(k)+"</a></b>] " //执行这里时候出错
end if
next
response.write " <a href=database_manage.asp style='TEXT-DECORATION: underline'><font color=red>到管理员首页</font></a>"
response.write "</p>"
end sub
%>
</body>
比如当我查询的条件是:type=9的时候
运行时候显示如下:
共39项资料 分页 [1] [2] 到管理员首页
第一页的数据能正常显示出来。
当我按下[2] 时候应当显示出数据,但是却显示:
还 没 有 任 何 资 料 !
当我按下[2] 时:地址为:
http://..../searchbybanjianhao_USER_TYPE_ACCESS.asp?page=2&type=9