| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 520 人关注过本帖
标题:分页程序为什么每页显示的内容都一样啊?晕~!
只看楼主 加入收藏
Philomena
Rank: 1
等 级:新手上路
帖 子:99
专家分:0
注 册:2006-8-23
收藏
 问题点数:0 回复次数:3 
分页程序为什么每页显示的内容都一样啊?晕~!

<%
sql="select * from T_wtx"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,3
if rs.eof and rs.bof then
%>
<%="暂时还没有留言"%>
<%
else
rs.pagesize=11
'设置每页的记录数
total=rs.pagecount
page=int(request("page"))
if page<=0 then page=1
if request("page")="" then page=1
rs.Absolutepage=page
totalrecord=rs.RecordCount
'rs.recordcount 显示记录总条数
rs.movelast
%>


<%
dim a
a=1
do until rs.bof
homepage=rs("L_homepage")
qq=rs("L_qq")
content=rs("L_content")
usr=rs("L_usr")
email=rs("l_email")
addtime=rs("L_date")
security=rs("L_security")
face=rs("L_face")
sex=rs("L_sex")
img="images/"&face&".gif"
%>
<table width="75%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" bgcolor="#FFFFFF"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><center>
<span class="word">留言者信息</span>
</center></td>
<td>主页<img src="images/home.gif" alt="主页:<%=homepage%>" width="16" height="16" />   邮箱<img src="images/mail.gif" alt="邮箱:<%=email%>" width="14" height="15" />   QQ:<img src="images/qq.gif" alt="QQ:<%=qq%>" width="16" height="16" /></td>
</tr>
<tr>
<td>
<% if qq<>"" then %>
<center><img src="http://qqshow-user.tencent.com/<%=qq%>/11/00/"></center>
<%
else
%>
<%
if sex="1" then
%>
<center><img src="images/gg.gif"></center>
<%else%>
<center><img src="images/mm.gif"></center>
<%
end if
end if%>

</td>
<td width="82%"><img src="<%=img%>">
<%
if security="1" then
%>
<center>这是保密的留言,只有管理员才能查看</center>
<%else%>
<%=content%>
<%end if%></td>
</tr>
<tr>
<td><span class="word">姓名:</span><b><%=usr%></b></td>
<td width="82%">留言时间<img src="images/time.gif" alt="留言时间" width="16" height="15" /><%=addtime%></td>
</tr>

</table></td>
</tr>
</table>
<%
a=a+1
rs.moveprevious
if a>rs.pagesize then exit do
loop
end if%>
<table width="75%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
共<%=totalrecord%>条留言 每页显示<%=viewsize%>条 分<%=total%>页 
<%
for i=1 to total
%>
<a href=index.asp?page=<%=i%>>第(<%=i%>)页</a>
<%next%>
</td>
</tr>
</table>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>


大家帮我看看是哪句代码错了 郁闷死了 分页的所有页面的都显示的是同一内容,我看了N遍代码,好像没什么错误啊~~ 谁知道啊~

搜索更多相关主题的帖子: sql request 
2006-11-14 20:35
做人很低调
Rank: 5Rank: 5
等 级:贵宾
威 望:18
帖 子:1268
专家分:0
注 册:2006-8-2
收藏
得分:0 
rs.movelast 这样不是把指针移动到最后了么?

应该是这样吧
rs.pagesize = 11
mrecord = rs.pagesize
t = (page - 1) * mrecord
rs.move t

其实我很低调,只是你不知道...
2006-11-15 16:30
yaxuxu
Rank: 1
等 级:新手上路
帖 子:53
专家分:0
注 册:2006-10-11
收藏
得分:0 
movenext

[此贴子已经被作者于2006-11-16 8:30:51编辑过]


2006-11-16 08:30
Philomena
Rank: 1
等 级:新手上路
帖 子:99
专家分:0
注 册:2006-8-23
收藏
得分:0 
这个问题已经解决了 Thank you all the same~

2006-11-16 10:01
快速回复:分页程序为什么每页显示的内容都一样啊?晕~!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012322 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved