帮我看看这个asp分页程序,在线等
<%@Language=VBScript%><%dimcn,rs,sql,i,biaotibaseclass="200"setcn=Server.CreateObject...
<%@ Language=VBScript%>
<%
dim cn, rs, sql, i, biaoti
baseclass = "200"
set cn = Server.CreateObject("adodb.Connection")
set rs = Server.CreateObject("adodb.Recordset")
cn.Open mycnstr
classcode = Request.QueryString("classcode")
pageno = toInt(Request.QueryString("pageno"), 1, "")
if not isnumeric(classcode) then classcode = ""
if classcode="" then
sql="select top 1 classcode,classname from miscell_class where baseclass='"+baseclass+"' and flag='0' order by sortnum"
else
sql="select classcode,classname from miscell_class where classcode='"+classcode+"' and flag='0'"
end if
rs.Open sql,cn,0,1,1
if not rs.EOF then
classcode=rs(0)
classname=trim(rs(1))
else
Response.Redirect "default.asp"
end if
rs.Close
%>
<%
sql="select keyno,title,creadate,querycount from miscell where classcode='" & classcode & "' and state='1' order by sortnum desc"
rs.Open sql,cn,1,1,1
pagesize = 6
rs.PageSize=pagesize
pagecount = rs.PageCount
reccount = rs.RecordCount
pageno = toInt(pageno, 1, pagecount)
if pageno > 1 then rs.AbsolutePage = pageno
i=1
do while not rs.EOF and i<=pagesize
biaoti= rs("title")
%>
<信息显示列表>
<%
i = i + 1
rs.MoveNext
loop
rs.Close
%>
<% If Request("Page")<>"" and Session("Page")<>Request("Page") Then Session("Page")=Request("Page")
If Request("Point")<>"" and Session("Point")<>Request("Point") Then Session("Point")=Request("Point")
If Session("Point")<2 Then Session("Point")=2
If Session("Point")="" Then Session("Point")=14
If Session("Page")="" Then Session("Page")=1 %>
<%
If pagecount mod Session("Point")=0 Then
n= pagecount \ Session("Point")
Else
n= pagecount \ Session("Point")+1
End If
%>
<form action="news-sj.asp" method=Post class="Text_Black">
<div align="center">共<b> </b><b><%=reccount%></b>项
<%If Session("Page")<2 Then%>
<font color="#999999">首页</font> <font color="#999999">上一页</font>
<%Else%>
<a href="news-sj.asp?Page=1" class="List_Black">首页</a>
<a href="news-sj.asp?Page=<%=Session("Page")-1%>" class="List_Black">上一页</a>
<%
End If
If n-Session("Page")<1 Then
%>
<font color="#999999">下一页</font> <font color="#999999">末页</font>
<%Else%>
<a href="news-sj.asp?Page=<%=Session("Page")+1%>" class="List_Black">下一页</a>
<a href="news-sj.asp?Page=<%=n%>" class="List_Black">末页</a>
<%End If%>
页次:<strong><%=Session("Page")%>/<%=n%></strong>页 转到: 第
<input name="Page" size="6" value="<%=Session("Page")%>">
页
<input type="submit" value="GO" name="Change_Page" class="Text_Black">
</form>
要怎么样修改才能让这个分页程序正常显示啊,我都弄了好久了,一直没研究明白,望不吝赐教!!
QQ:19139592 展开
<%
dim cn, rs, sql, i, biaoti
baseclass = "200"
set cn = Server.CreateObject("adodb.Connection")
set rs = Server.CreateObject("adodb.Recordset")
cn.Open mycnstr
classcode = Request.QueryString("classcode")
pageno = toInt(Request.QueryString("pageno"), 1, "")
if not isnumeric(classcode) then classcode = ""
if classcode="" then
sql="select top 1 classcode,classname from miscell_class where baseclass='"+baseclass+"' and flag='0' order by sortnum"
else
sql="select classcode,classname from miscell_class where classcode='"+classcode+"' and flag='0'"
end if
rs.Open sql,cn,0,1,1
if not rs.EOF then
classcode=rs(0)
classname=trim(rs(1))
else
Response.Redirect "default.asp"
end if
rs.Close
%>
<%
sql="select keyno,title,creadate,querycount from miscell where classcode='" & classcode & "' and state='1' order by sortnum desc"
rs.Open sql,cn,1,1,1
pagesize = 6
rs.PageSize=pagesize
pagecount = rs.PageCount
reccount = rs.RecordCount
pageno = toInt(pageno, 1, pagecount)
if pageno > 1 then rs.AbsolutePage = pageno
i=1
do while not rs.EOF and i<=pagesize
biaoti= rs("title")
%>
<信息显示列表>
<%
i = i + 1
rs.MoveNext
loop
rs.Close
%>
<% If Request("Page")<>"" and Session("Page")<>Request("Page") Then Session("Page")=Request("Page")
If Request("Point")<>"" and Session("Point")<>Request("Point") Then Session("Point")=Request("Point")
If Session("Point")<2 Then Session("Point")=2
If Session("Point")="" Then Session("Point")=14
If Session("Page")="" Then Session("Page")=1 %>
<%
If pagecount mod Session("Point")=0 Then
n= pagecount \ Session("Point")
Else
n= pagecount \ Session("Point")+1
End If
%>
<form action="news-sj.asp" method=Post class="Text_Black">
<div align="center">共<b> </b><b><%=reccount%></b>项
<%If Session("Page")<2 Then%>
<font color="#999999">首页</font> <font color="#999999">上一页</font>
<%Else%>
<a href="news-sj.asp?Page=1" class="List_Black">首页</a>
<a href="news-sj.asp?Page=<%=Session("Page")-1%>" class="List_Black">上一页</a>
<%
End If
If n-Session("Page")<1 Then
%>
<font color="#999999">下一页</font> <font color="#999999">末页</font>
<%Else%>
<a href="news-sj.asp?Page=<%=Session("Page")+1%>" class="List_Black">下一页</a>
<a href="news-sj.asp?Page=<%=n%>" class="List_Black">末页</a>
<%End If%>
页次:<strong><%=Session("Page")%>/<%=n%></strong>页 转到: 第
<input name="Page" size="6" value="<%=Session("Page")%>">
页
<input type="submit" value="GO" name="Change_Page" class="Text_Black">
</form>
要怎么样修改才能让这个分页程序正常显示啊,我都弄了好久了,一直没研究明白,望不吝赐教!!
QQ:19139592 展开
2个回答
展开全部
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询