这是一个分页程序,请大家帮我解决个问题
<%
dim action
action=request.QueryString("action")
Const MaxPerPage=10 '定义每页显示记录数
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
%>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from test",conn,1,1
%>
<%
a="news" '这个是定义不同条件下打开数据表,以定义调用分页程序文件的参数。可多加参数,但要相应修改后面的参数。
if err.number<>0 then
response.write "数据库中暂时无数据
" end if if rs.eof And rs.bof then Response.Write "对不起,没有符合条件记录!
" else 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 showContent showpage totalput,MaxPerPage,"fylogo.asp?lx="&a&"" else if (currentPage-1)*MaxPerPage