| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 407 人关注过本帖
标题:[讨论]分页问题
只看楼主 加入收藏
fanbingbing
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-6-6
收藏
 问题点数:0 回复次数:3 
[讨论]分页问题
大家好,我这里有个问题需要讨论啊,我作的网站 数据表里面需要显示很多的信息字段,现在需要作一个分页,但是我不明白如何去作?希望大家多多帮忙,有源代码的更好 不过尽量要正确的哦,谢谢了。
搜索更多相关主题的帖子: 如何 网站 源代码 数据表 
2006-06-09 18:40
icecool
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:20
帖 子:1215
专家分:1366
注 册:2005-3-14
收藏
得分:0 

有没有搞错?你以为别人有病花钱来看你问问题啊!
以前的贴子中有此内容,自已看看

http://www.bc-cn.net/bbs/dispbbs.asp?BoardID=10&replyID=150804&id=66915&skin=0


http://toorup.3v.do
loading...
2006-06-09 19:28
fanbingbing
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-6-6
收藏
得分:0 

我也不知道怎么设的呀,不会操作呀。对不起啊。

2006-06-10 09:20
mamu123456
Rank: 1
等 级:新手上路
帖 子:97
专家分:0
注 册:2006-6-5
收藏
得分:0 

<%
Connstr="DBQ="+server.mappath("sss/main.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};DriverId=25;"
set conn=server.createobject("adodb.connection")
conn.open Connstr

sqlstr="select * from lyd_images order by lyd_img_01 desc"
set rs=server.createobject("adodb.recordset")
rs.open sqlstr,conn,1,3
dim intrec
dim nowpage
const adopenstatic=3
const adlockreadonly=1
const adcmdtable=2
cursortype=adopenstatic
locktype=adlockreadonly
set rs=server.createobject("adodb.recordset")
rs.open sqlstr,conn,cursortype,locktype,options
if rs.eof then
response.redirect "error.asp"
end if
dim counter,howpage
rs.pagesize=4
thesize=rs.pagesize
counter=rs.RecordCount
howpage=rs.pagecount
dim thecursor

If Request.QueryString("PAGE")=""Then
session("intPage")=1
Else
If session("intPage")<1 Then
session("intPage")=1
Else
If session("intPage")>rs.PageCount Then
session("intPage")=rs.PageCount
Else
nowpage=request("page")
session("intPage")=CInt(nowpage)
End If
End If
End If

rs.AbsolutePage=session("intPage")
thispage=rs.absolutepage%>
共有 <font color="#FF0000"><%=rs.pagecount%></font> 页 <font color="#FF0000"><%=counter%></font>
个系列&nbsp;当前第 <font color="#FF0000"><%=session("intpage")%></font>
页&nbsp;      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%if rs.pagecount>1 then%>
<a href="zuopizhanshi.asp?page=1" class="top1">首页</a>
<% end if%>
<%if session("intpage")>1 then%>
<a href="zuopizhanshi.asp?page=<%=session("intPage")-1%>" class="top1">上页</a>
<%
end if%>
<%if session("intpage")<rs.pagecount then%>
<a href="zuopizhanshi.asp?page=<%=session("intPage")+1%>" class="top1">下页</a>
<%
end if%>
<%if rs.pagecount>1 then%>
<a href="zuopizhanshi.asp?page=<%=rs.pagecount%>" class="top1">末页</a>
<%
end if%>
<div align="center">
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class=fame5 valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" >
<tr>
<td height="2" valign="top" width="98%"> <table border=0 width="100%" cellpadding="7" cellspacing="12">
<%if not rs.eof then
dim i
i = 1
while not rs.eof and i<rs.pagesize+1%>
<%if (i mod 2)=1 then%>
<tr class="bodystyle">
<td width="50%" valign="top"> <div align="left" class="style6">
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td height="81" valign="top"> <div align="center">
<p><a href="zuopinzhanshi1.asp?lyd_img_01=<%=rs("lyd_img_01")%>" target="_blank"><img src="sss/<%=rs("lyd_img_05")%>" width="90" height="90" border="0" ></a>
</p>
</div></td>
</tr>
<tr>
<td valign="top"><div align="center"><a href="zuopinzhanshi1.asp?lyd_img_01=<%=rs("lyd_img_01")%>" target="_blank"><%=rs("lyd_img_03")%></a></div></td>
</tr>
<tr> </tr>
</table>
<%
i=i+1
rs.movenext
%>
<%else%>
</div>
<td width="50%" valign="top"> <div align="left" class="style6">
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td valign="top"> <div align="center">
<p><a href="zuopinzhanshi1.asp?lyd_img_01=<%=rs("lyd_img_01")%>" target="_blank"><img src="sss/<%=rs("lyd_img_05")%>" width="90" height="90" border="0" ></a></p>
</div></td>
</tr>
<tr>
<td valign="top"><div align="center"><a href="zuopinzhanshi1.asp?lyd_img_01=<%=rs("lyd_img_01")%>" target="_blank"><%=rs("lyd_img_03")%></a></div></td>
</tr>
<tr> </tr>
</table>
<%
i=i+1
rs.movenext
%>
<%end if%>
<%wend
else%>
<%response.write "no results:("%>
<%end if%>
</div></table></td>
</tr>
</table></td>
</tr>
</table>
<div align="right">
<%
rs.close
set rs=nothing
conn.close
set conn=nothing

%>

这个应该比较简单点的代码,你只要套用一下就可以了,

2006-06-10 09:57
快速回复:[讨论]分页问题
数据加载中...
 
   



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

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