高分求教呀,急求!!!!

lwjhugo 2003-08-23 10:39:37
我想在ASP里做一个能分页显示数据库(我用的是SQLSever)的记录, 一页显示10条,能显示总页数,当前页数,可以有上一页,下一页选择, 并且一页里有10页数字选择,点击一个数字能到达该页,如果超过10页的话可以显示下一个10页, 请问该怎么做呀?凡是回帖的必有分加, 谢谢!
...全文
29 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
arcow 2003-08-23
  • 打赏
  • 举报
回复
lwjhugo 2003-08-23
  • 打赏
  • 举报
回复
你们好,好多谢你们的热心帮忙,你的邮箱是lwjhugo@163.com,请你们将代码发到我的邮箱,谢谢!
zorou_fatal 2003-08-23
  • 打赏
  • 举报
回复
告诉邮箱,发个详细的给你看看。
bananasmiling 2003-08-23
  • 打赏
  • 举报
回复
只是借用上面的,如果还想要详细的..请给我发信.
bananasmiling 2003-08-23
  • 打赏
  • 举报
回复
SQLStr="select * from [bbs1] where (Solution=1) and (boardID like '"&forum_id&"%') order by DateAndTime DESC"
rs.open SQLStr,conn,1,1

rs.PageSize=10
pagecount=rs.PageCount
cur_page=int(request.QueryString("page"))
if cur_page<=0 then cur_page=1 end if
if request.QueryString("page")="" then cur_page=1 end if
rs.AbsolutePage=cur_page
end if

dim totalput
dim MaxPerPage
dim currentpage
MaxPerPage=10 '这个地方可以改成你想要的每页显示的记录
totalput=rs.recordcount
response.write cstr(totalput)&"篇"
currentpage=0
if (totalput mod MaxPerPage=0) then
currentpage=totalput\MaxPerPage
else
currentpage= totalPut\MaxPerPage + 1
end if
dim i
for i=1 to currentpage
response.write " "
if i=cur_page then
response.write "<font color="&"red"&">"&i&"</font>"
else
response.write "<a href=forum.asp?forum_id="&trim(forum_id)&"&page="&i&" target=_self onclick=javascript:>"&i&"</a>"
end if
next
if rs.eof and rs.bof then
response.write "<tr><td >"
response.write "<font color=red><p align='right'><strong> 还 没 有 任 何 文 章</strong></p></font>"
response.write "</tr></td>"
else
do while not rs.eof
response.write "<a href=tiezi3.asp?ID=<% =trim(rs("AnnounceID"))%>&Solution=<%=rs("Solution")%> target=_blank ><%=rs("Topic")%></a></font><font color="black" size="-1">(<%=trim(rs("Username"))%>)</font></td>"
rs.movenext
loop
zurong 2003-08-23
  • 打赏
  • 举报
回复
你自己整理的看看

SQLStr="select * from [bbs1] where (Solution=1) and (boardID like '"&forum_id&"%') order by DateAndTime DESC"
rs.open SQLStr,conn,1,1

rs.PageSize=10
pagecount=rs.PageCount
cur_page=int(request.QueryString("page"))
if cur_page<=0 then cur_page=1 end if
if request.QueryString("page")="" then cur_page=1 end if
rs.AbsolutePage=cur_page
end if

dim totalput
dim MaxPerPage
dim currentpage
MaxPerPage=10
totalput=rs.recordcount

response.write cstr(totalput)&"篇"
currentpage=0
if (totalput mod MaxPerPage=0) then
currentpage=totalput\MaxPerPage
else
currentpage= totalPut\MaxPerPage + 1
end if
dim i
for i=1 to currentpage
response.write " "
if i=cur_page then
response.write "<font color="&"red"&">"&i&"</font>"
else
response.write "<a href=forum.asp?forum_id="&trim(forum_id)&"&page="&i&" target=_self onclick=javascript:>"&i&"</a>"
end if
next
if rs.eof and rs.bof then
response.write "<tr><td >"
response.write "<font color=red><p align='right'><strong> 还 没 有 任 何 文 章</strong></p></font>"
response.write "</tr></td>"
else
do while not rs.eof
response.write "<a href=tiezi3.asp?ID=<% =trim(rs("AnnounceID"))%>&Solution=<%=rs("Solution")%> target=_blank ><%=rs("Topic")%></a></font><font color="black" size="-1">(<%=trim(rs("Username"))%>)</font></td>"
rs.movenext
loop

tiandiren2008 2003-08-23
  • 打赏
  • 举报
回复
还是以邮件形势给你吧!
tiandiren@oilchem.net
coffee_cn 2003-08-23
  • 打赏
  • 举报
回复
发邮件到hanf@myce.net.cn
我送一个给你

28,390

社区成员

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

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