可以实现吗??

twtetgso 2002-01-18 07:43:45
请问在WIN98+PWS 下使用ASP可以实现分页显示吗??谁有较好的例子看一下??
...全文
130 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
希偌 2002-01-18
  • 打赏
  • 举报
回复
<% @ language=vbscript %>
<% option explicit %>
<% response.expires=0 %>

<%
dim start0,end0
end0=Timer
start0=request.cookies("second_start")
if request.cookies("second_start")="" then
response.cookies("login")="no"
elseif end0-start0>900 then
response.cookies("login")="no"
end if
%>

<%
const intpagesize=30
dim rst,strpath,strconn,straccess,straccess1,rst1
Dim intcur,inttotal,i,j
Dim rscount
if session("intcur")="" then
intcur=1
else
intcur=session("intcur")
end if
strpath=server.mappath("ttsj.mdb")
strconn="Driver={Microsoft Access Driver (*.mdb)};DBQ=" & strpath
set rst=server.createobject("adodb.recordset")
set rst1=server.createobject("adodb.recordset")
straccess="select * from jbxx where sfhf='0' order by id desc"
rst.CursorLocation=2
rst.CursorType=3
rst.CacheSize=intpagesize
rst.open straccess,strconn
rst.PageSize=intpagesize
if Not rst.EOF then
rst.AbsolutePage=intcur
end if
inttotal=rst.pagecount
rst.PageSize=intpagesize
session("intcur1")=intcur
session("inttotal")=inttotal
rscount=rst.recordcount
%>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>贴图交流区</title>
<link REL="SHORTCUT ICON" href="tjhq.ico">
<style type="text/css">
<!--
a,a:link {color:#000000;text-decoration:none}
a:visited {color:#888888;text-decoration:none}
a:active {color:#888888;text-decoration:none}
a:hover {color:#ff0000;text-decoration:underline;cursor:crosshair}
body {font-size:10pt;'Arial';}
tr,td {font-size:10pt;'Arial';word-break:break-all}
TABLE {BORDER-BOTTOM: 1px; BORDER-LEFT: 0px; BORDER-TOP: 0px}
-->
</style>
</head>

<body>

<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top"><a href="http://beyonsq.yeah.net" target="_blank"><img border="0" src="bbb.jpg" width="208" height="95" alt="神权居"></a></td>
<td rowspan="2" width="82%">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td colspan="2">
<p align="right"><a href="./manage.asp" target="_blank"><img border="0" src="comicbbs.gif" width="183" height="45" alt="管理入口"></a>
</td>
</tr>
<tr>
<td bgcolor="#000000" colspan="2"></td>
</tr>
<tr>
<td bgcolor="#000000" width="1"></td>
<td>

<p align="right"><a href="http://beyondsq.yeah.net/" target="_blank"><img border="0" src="beyondsq.gif" width="288" height="35"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#000000" height="2" width="18%"></td>
</tr>
</table>
<div align="left">
<table border="0" cellPadding="0" cellSpacing="0" height="59">
<tbody>
<tr>
<td colSpan="3" height="27" vAlign="top">
<table border="0" cellPadding="0" cellSpacing="0" width="90%">
<tbody>
<tr>
<td><img border="0" src="announce.gif" width="20" height="17">版主:
xiruo  </td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td height="1" vAlign="top" width="40%">
<div align="center">
<table border="0" cellPadding="0" cellSpacing="0" width="95%">
<tbody>
<tr>
<td colSpan="2" height="20"><font color="#ff0000"><b>[火热推荐]</b></font></td>
<tr>
<td height="20"><img border="0" src="dot.gif" width="12" height="12">

<td> </td>
</tr>
<tr>
<td height="20"><img border="0" src="dot.gif" width="12" height="12">

<td> </td>
</tr>
<tr>
<td height="20"><img border="0" src="dot.gif" width="12" height="12">

<td> </td>
</tr>
<tr>
<td height="20"><img border="0" src="dot.gif" width="12" height="12">

<td> </td>
</tr>
<tr>
<td height="20"><img border="0" src="dot.gif" width="12" height="12">

<td> </td>
</tr>
</tbody>
</table>
</div>
<td height="32" vAlign="top" width="40%">
<div align="center">
<table border="0" cellPadding="0" cellSpacing="0" width="95%">
<tbody>
<tr>
<td height="20"><img border="0" src="dot.gif" width="12" height="12">

<td> </td>
</tr>
<tr>
<td height="20"><img border="0" src="dot.gif" width="12" height="12">

<td> </td>
</tr>
<tr>
<td height="20"><img border="0" src="dot.gif" width="12" height="12">

<td> </td>
</tr>
</tbody>
</table>
</div>
<td height="32" width="1%">
<div align="center">
<% if not request.cookies("login")="yes" then %>
<table border="0" cellPadding="0" cellSpacing="0">
<tbody>
<tr>
<td height="20">
<p align="center"><img border="0" src="logintop.gif" width="155" height="20"></p>
</td>
</tr>
<tr>
<td background="loginbg.gif" height="90" vAlign="top"> <form action="./login.asp" method="post" name="login">
<table>
<tbody>
<tr>
<td>
<p align="center">用户名
<input type="text" maxLength="12" name="name" size="12" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #ffffff 0px solid; BORDER-RIGHT: #ffffff 0px solid; BORDER-TOP: #ffffff 0px solid">
<br>
密  码
<input maxLength="10" name="pass" size="12" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #ffffff 0px solid; BORDER-RIGHT: #ffffff 0px solid; BORDER-TOP: #ffffff 0px solid" type="password">
<br>
<br>
<a href="vbscript:login.submit"><img border="0" src="b1.gif" width="37" height="18"></a>
<a href="regist.asp"><img alt="注册" border="0" src="b2.gif"></a>
<a href="password.asp" target="_blank"><img border="0" src="forgot.gif" width="60" height="18"></a></p>
</td>
</tr></FORM>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<% else %>
<table border="0" cellPadding="0" cellSpacing="0">
<tbody>
<tr>
<td height="20">
<p align="center"><img border="0" src="logintop.gif" width="155" height="20"></p>
</td>
</tr>
<tr>
<td background="loginbg.gif" height="90" vAlign="top"> <form action="./login.asp" method="post" name="unlogin">
<table width="150">
<tbody>
<tr>
<td>
<p align="center"><a href="javascript:document.unlogin.submit();">注销用户</a></p>
</td>
</tr></FORM>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<% end if %>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div align="center">

<table border="0" cellPadding="0" cellSpacing="0" width="100%">
<tbody>
<tr>
<td colSpan="2">
<hr color="#000080" SIZE="1">
</td>
</tr>
<tr>
<td colSpan="2"><% =request.cookies("login") %>共有 <font color="#ff0000">
<% =rst.recordcount %>
</font> 条帖子,共 <font color="#ff0000">
<% =inttotal %>
</font> 页,目前为第 <font color="#ff0000">
<% =intcur %>
</font> 页,每页:<font color="#ff0000">
<% =intpagesize %>
</font> 帖 [<% for j=1 to inttotal %><% if j=1 then %><a href="./page.asp?page=<% =j %>"><% =j %></a><% else %>|<a href="./page.asp?page=<% =j %>"><% =j %></a><% end if %><% next %>]
<% if intcur>1 then %>
<a href="./page.asp?page=previous">[上一页]</a> 
<% end if %>
<% if intcur<inttotal then %>
<a href="./page.asp?page=next">[下一页]</a> 
<% end if %>
<a href="./page.asp?page=first">[首页]</a>  <a href="./page.asp?page=last">[尾页]</a></td>
</tr>
<tr> <form name="inputform1" action="findsend.asp" method="post">
<td colspan="2">
<div align="right"><select style="font-size: 9pt; color: #000000; height: 25; background-color: #ffeeee; width: 137; border: 1px solid black" name="ss1" size="1">
<option value="select1" selected>选择搜索方式!
<option value="mm">模糊查询</option>
<option value="jj">精确匹配</option>
</select>
 <font size="3"> </font>
<select style="font-size: 9pt; color: #000000; height: 25; background-color: #ffeeee; width: 137; border: 1px solid black" name="ss2" size="1">
<option value="select2" selected>选择搜索关键字!
<option value="title">帖子标题</option>
<option value="name">发帖人姓名</option>
</select>
 <font color="#000000" size="1">
<input type="text" name="ss3" size="12" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #ffffff 0px solid; BORDER-RIGHT: #ffffff 0px solid; BORDER-TOP: #ffffff 0px solid">
</font> [<a href="vbscript:find()">搜索</a>]</div>
</td></form>
</tr>
<tr>
<td width="315"><a href="./new.asp"><img alt="发表文章" border="0" src="new_topic.gif"></a>
<a href="./good.asp" target="_blank"><img alt="论坛精华" border="0" src="elite_topic.gif"></a>
<a href="javascript:location.reload();"><img alt="刷新" border="0" src="reload_topic.gif"></a></td>
<td width="448">
<div align="right"><a href="index1.asp">查看我的帖子</a>  <a href="index0.asp">按回帖时间排序</a>
</div>
</td>
</tr>
<tr>
<td colSpan="2">
<hr color="#000080" SIZE="1">
</td>
</tr>
</tbody>
</table>
</div>
<table border="1" borderColor="#000000" cellPadding="3" cellSpacing="0" width="100%">
<tbody>
<tr align="middle" bgColor="#5a7eba">
<td width="8%"><font color="#ffffff">帖号</font>
<td width="40%"><font color="#ffffff">文 章 主 题</font>
<td width="16%"><font color="#ffffff">作者</font>
<td width="8%"><font color="#ffffff">人气</font>
<td width="10%"><font color="#ffffff">字节数</font>
<td width="18%"><font color="#ffffff">回帖时间</font></td>
</tr>
<% if rst.eof then %>
<tr align=middle bgcolor=#f0f3fa>
<td colspan=6 align=center onmouseout="this.style.background='#f0f3fa'" onmouseover="this.style.background='#fafbfc'">
本论坛还没有帖子! </td>
</tr>
<% end if %>
<%
i=0
do while not rst.eof and i<rst.PageSize
if rst1.state=1 then
rst1.close
end if
straccess1="select * from register where name='" & rst("name") & "'"
rst1.cursortype=1
rst1.locktype=3
rst1.open straccess1,strconn
%>
<tr align="middle" bgColor="#f0f3fa">
<td width="8%">
<%
dim rsta
set rsta=server.createobject("adodb.recordset")
rsta.cursortype=1
rsta.locktype=3
rsta.open "select * from jbxx where sfhf='1' and hfid='" & rst("id") & "' order by time desc",strconn
if rsta.eof then
response.write rst("id")
else
response.write "<font color=#ff0000>(+" & rsta.recordcount & ")</font>"
end if
rsta.close
%>
</td>
<td align="left" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#fafbfc'" width="40%"><img border="0" src="./images/<% =rst("face") %>.gif">
<a href="content.asp?No=<% =rst("id") %>">
<% =rst("title") %>
</a>
<td align="left" width="16%"><a href="yourdata.asp?name=<% =rst("name") %>" target="_blank"><img border="0" src="./image/<% =rst1("face") %>.gif">
<% =rst("name") %>
</a>
<td width="8%">
<% =rst("welcome") %>
<td width="10%">
<% =rst("size") %>

<td width="18%">
<% =rst("replytime") %>
</td>
</tr>
<%
rst.movenext
rst1.close
i=i+1
loop
%>
</tbody>
</table>
<table bgColor="#116199" border="0" cellPadding="0" cellSpacing="0" height="18" width="100%">
<tbody>
<tr>
<td> </td>
</tr>
</tbody>
</table>
</center>

</body>

</html>


<script language=vbscript>
<!--
function find
dim frmtmp
set frmtmp=document.inputform1
if frmtmp.ss1.value="select1" then
msgbox "请选择搜索方式!",32,"警告!"
elseif frmtmp.ss2.value="select2" then
msgbox "请选择搜索关键字!",32,"警告!"
elseif trim(frmtmp.ss3.value)="" then
msgbox "搜索内容不能为空!",32,"警告!"
frmtmp.ss3.focus()
else
frmtmp.submit
end if
end function
-->
</script>

28,406

社区成员

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

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