多循环分页问题!盼解决!!!!!!!!!!!!!!!!1

yangxuhua 2004-09-30 08:27:52
<%
Set Rs1 = Server.CreateObject("ADODB.RecordSet")
sql="select * from doc order by id DESC"
rs1.open sql,conn,3,3
if rs1.eof then
%>
<td valign="top" align="left">
<div align="center">没有照片<br>
</div></td>
<%end if
i=0
do while not rs1.eof
i=i+1
%>
<td width="434" align="left" valign="middle">
<table width="370" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111" bgcolor="#F9F9F9" style="border-collapse: collapse" bordercolordark="#FFFFFF" bordercolorlight="#999900">
<tr>
<td width="108" height="120" rowspan="2" valign="middle" bgcolor="#F7F7F7">
<div align="center"><img src="admin/img/doc/<%=rs1("pic")%>" width="95" height="114" border="0"></div></td>
<td width="67" height="0" valign="middle" bgcolor="#F7F7F7"><span class="150"><img src="images/dot.gif" width="9" height="9"></span><%=rs1("uname")%><br></td>
<td width="195" valign="middle" bgcolor="#F7F7F7">职称:<%=rs1("zw")%></td>
</tr>
<tr>
<td colspan="2" valign="top" bgcolor="#F7F7F7"><%=rs1("jj")%></td>
</tr>
<tr>
<td height="22" colspan="3" align="center" valign="top"> <div align="right"><font color="259EA0"><a href="linenet/index.asp?uname=<%=rs1("uname")%>&id=<%=rs1("id")%>&zw=<%=rs1("zw")%>">>> <font color="259EA0">在线咨询</font></a></font></div></td>
</tr>
</table></td>
<%
if (i mod 2=0) and i>=2 then
%>
</tr>
<tr>
<%
end if
if i>=22 then exit do end if
rs1.movenext
loop
rs1.close
%>
上面是每行显示两条记录。我现在想 对它分页,不知道该怎么搞。在线等待。因本人是个先手,没有多少分给,请原谅。助人乃快乐之本嘛1
...全文
93 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
yangxuhua 2004-09-30
  • 打赏
  • 举报
回复
http://tmp.027.net/0710/hospitoal/myfc.asp,大家先看看这个页面,数据是后台提出来的。每行两条记录。我是对列循环,以前都是对行循环。分页好搞,楼上的兄弟说的方法我试过了,好象不行。
tpf9000 2004-09-30
  • 打赏
  • 举报
回复
支持楼上所有,网上分页的很多不同的,可以参照一下
zfhdream 2004-09-30
  • 打赏
  • 举报
回复
楼上的具体差不多了~关键就是定义几个关键字~~
取得他们的值~~然后调用~~
yangxuhua 2004-09-30
  • 打赏
  • 举报
回复
多谢各位
feifeizaizhe 2004-09-30
  • 打赏
  • 举报
回复
分页就是改变一些记录集合的属性
比如:
rs1.pagesize=20 //每页显示记录数
rs1.AbsolutePage=line //当前页数



slimpotato 2004-09-30
  • 打赏
  • 举报
回复
先是:
....
rs1.open sql,conn,3,3
rs1.pagesize=6
mypagecount=rs1.pagecount
page=int(request.QueryString("page"))
if page<=0 or page="" then page = 1
rs1.absolutepage=page
%>

然后在:
.......
<% rs.movenext
loop
%>

<div align="right">
当前页为 <font color="#FF0000">
<%
if page="" then
Response.Write("0")
else
Response.Write(page)
end if
%>
</font> / 
总 <font color="#FF0000">
<%
if mypagecount="" then
Response.Write("0")
else
Response.Write(mypagecount)
end if
%>
</font> 页  
<%
if page<1 or page>mypagecount then '没有记录
Response.Write("...........")

else
if page<=mypagecount and page<>1 then
Response.Write "<a href=myfc.asp?page=" & page-1 & ">上一页</a> "
else
Response.Write "上一页 "
end if
for m=1 to mypagecount
if page=m then
Response.Write m & " "
else
Response.Write "<a href=myfc.asp?page=" & m & ">" & m & "</a> "
end if
next
if page<>mypagecount then
Response.Write "<a href=myfc.asp?page=" & page+1 & ">下一页</a>"
else
Response.Write "下一页"
end if
end if
%>

</div>

具体的分页技术,你可以参考《十天学会ASP》,那上面写的蛮详细的
孟子E章 2004-09-30
  • 打赏
  • 举报
回复
分页就是计算记录集移动的数目,多行可参照
http://blog.csdn.net/net_lover/archive/2004/08/21/81031.aspx
yangxuhua 2004-09-30
  • 打赏
  • 举报
回复
http://tmp.027.net/0710/hospitoal/myfc.asp这是上面所对应的页面。我要对它进行分页。哪位高手帮忙解决·!!!!!!!!!11

28,391

社区成员

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

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