分页显示,本页可以显示,但是按下页时就没数据,大伙帮帮我,看下这代码有咋错啊!!!!!

myveremy 2005-06-17 04:16:15
分页显示,本页可以显示,但是按下页时就没数据显示出来。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>ClientPVRListing</title>
</head>
<body>
<%
dim Curpage
If Request.QueryString("CurPage") = "" then
Curpage=1
Else
Curpage=cint(Request.QueryString("CurPage"))
End if
' response.write curpage
%>
<%
str1=cstr(request("D1"))
set conn=server.createobject("adodb.connection")
conn.connectionstring="driver={sql server};server=127.0.0.1;uid=sa;pwd=wu;database=wdd"
conn.open
set rs=server.createobject("adodb.recordset")
set rs.activeconnection=conn
rs.cursortype=3
rs.open "select * from pvrlisting order by programdate,programtime"
%>
<%
RS.PageSize=8 '每页条数
if CurPage>RS.Pagecount then CurPage=RS.Pagecount end if
%>
<form method="POST" action="ProgrammingCode.asp" onsubmit="return ChkFields()" name="send">
<h6 align="center"><font size="5">Step 1: Choose Programs</font>
</h6>
<table align="center" width="680" height="100" border="0" cellpadding="0" cellspacing="0">
<tr align="center">
<td align="center" class="high"><a href="programming.asp?CurPage=1">第一页</a>
<%if CurPage-1>=2 then%>
<a href="list.asp?CurPage=<%=CurPage-1%>">上一页</a>
<%end if%>
<%if CurPage+1<=RS.Pagecount and CurPage+1<>RS.Pagecount then%>
<a href="programming.asp?CurPage=<%=CurPage+1%>">下一页</a>
<% end if%> <%if RS.Pagecount>=3 then%>
<a href="programming.asp?CurPage=<%=rs.PageCount%>">最后页</a>
<% end if%> </td>
</tr>
</table>
<table align="center" border="1" width="905" height="59">
<tr><td bgcolor="#c0c0c0" width="55" >TIME</td>
<td bgcolor="#c0c0c0" width="250" ><img border="0" align="center" src="feicui.gif" width="60" height="30"></td>
<td bgcolor="#c0c0c0" width="250" ><img border="0" align="center" src="mingzhu.gif" width="60" height="30"></td> <td bgcolor="#c0c0c0" width="250" ><img border="0" align="center" src="bengang.gif" width="60" height="30"></td> <td bgcolor="#c0c0c0" width="250" ><img border="0" align="center" src="guoji.gif" width="60" height="30"></td> </tr>
<% i=0 dim id do while (rs.eof=false) and (i<RS.PageSize) if i mod 2 = 0 then color="#ffffff" else color="#FFFFCC" end if
%> <tr bgcolor="<%=color%>"> <td width="55" height="16"><%=rs("programtime")%>
<%currenttime=cdate(rs("programtime"))
nowtime=time
currentdate=cdate(rs("programdate"))
nowdate=date
%> <td width="251" height="16"><%=rs("pname1")%> <td width="253" height="16"><%=rs("pname2")%> <td width="253" height="16"><%=rs("pname3")%> <td width="253" height="16"><%=rs("pname4")%> </tr> <% i=i+1 rs.movenext loop % </table>
<%
rs.close
set rs=nothing
conn.close if conn.state=0 then end if set conn=nothing %>
<p align="center"><input type="submit" value=" Next " name="B1"></p> <hr> <p align="center"> </p> </form> </body>
...全文
100 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
jackycxg 2005-06-17
  • 打赏
  • 举报
回复

<%
RS.PageSize=8 '每页条数
if CurPage>RS.Pagecount then CurPage=RS.Pagecount end if
%>
改:
<%
RS.PageSize=8 '每页条数
if CurPage>RS.Pagecount then
CurPage=RS.Pagecount
end if
rs.absolutepage=curpage
%>
DrKnow 2005-06-17
  • 打赏
  • 举报
回复
好像没有把记录指针移动到要显示的页.
rs.absolutepage = Curpage
tony0115 2005-06-17
  • 打赏
  • 举报
回复
你没有使用 objRs.AbsolutePage
myveremy 2005-06-17
  • 打赏
  • 举报
回复
没有报错,就是没有数据显示出来。
lwx139 2005-06-17
  • 打赏
  • 举报
回复
报什么错?

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧