叶子分页类1

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Cls_Pages.asp"-->
<%
Rem =====================================================================================================
Rem = RCSfile:pageac.asp
Rem = 说明:ASP+Access分页类调用示范
Rem = Revision:0.02Beta
Rem = 程序:yezi(叶子)
Rem = Date:2004/08/26 09:41:10
Rem = QQ:311673,ICQ:96240724,MSN:ishows@msn.com,http://www.showo.com,http://www.54nb.com
Rem = Thanks:54NB-链子提供数据库以及指针用法,Dvbbs火狐和其他几个人员的口水帐讨论^_^
Rem = 承受记录条数:20W,未索引,最后页面速度在120ms
Rem = 下版本预计改进:showo_page.js文件取页数得自定义参数,类取页数得自定义参数
Rem =====================================================================================================

'-----------------------------------------------------------------------------------------------
On Error Resume Next
DIM startime,endtime
'统计执行时间
startime=timer()
'连接数据库
DIM Db,Conn,Rs
Db = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("./db.mdb")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open Db
'-----------------------------------------------------------------------------------------------
%>
<html>
<head>
<title>Access高效分页类</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body,table,td,p,li {font-size:12px}
a {font-size:12px;color:#000000;text-decoration: none}
INPUT {
 BORDER-TOP-WIDTH: 1px;
 PADDING-RIGHT: 1px;
 PADDING-LEFT: 1px;
 BORDER-LEFT-WIDTH: 1px;
 FONT-SIZE: 12px;
 BORDER-LEFT-COLOR: #cccccc;
 BORDER-BOTTOM-WIDTH: 1px;
 BORDER-BOTTOM-COLOR: #cccccc;
 PADDING-BOTTOM: 1px;
 BORDER-TOP-COLOR: #cccccc;
 PADDING-TOP: 1px;
 HEIGHT: 18px;
 BORDER-RIGHT-WIDTH: 1px;
 BORDER-RIGHT-COLOR: #cccccc;
 BACKGROUND-COLOR: #F2F8FF
}
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="760" border="0" cellspacing="2" cellpadding="2" align="center" height="30">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="760" border="1" cellspacing="0" cellpadding="4" align="center" bordercolordark="#FFFFFF" bordercolorlight="#CCCCCC">
  <tr align="center">
    <td width="60">ID</td>
    <td width="150">标题</td>
    <td width="*">内容(显示前20个字)</td>
    <td width="150">时间</td>
  </tr>
<%
Set ors=new Cls_Pages   '创建对象
ors.Conn=conn    '得到数据库连接
ors.RecPerPage=30 '每页记录条数
ors.CookieName="table1"    '存记录总数的cookiesname
ors.PageUrl=""    'showo_page.js的路径
ors.Term=0    '条件是否有变化(0无变化,1有变化,2不设置cookies也就是及时统计)
ors.Sql="id,aaaa,bbbb,cccc$table1$$$id" '字段,表,条件(需要where),排序,主ID
iRecCount=ors.RecCount() '记录总数
iRs=ors.ResultSet()    '返回ResultSet
If  iRecCount<1 Then%>
<tr bgcolor="">
    <td >暂无记录</td>   
  </tr>
<%
Else    
    For i=0 To Ubound(iRs,2)
 bgColor="#FFFFFF"
 if i mod 2=0 then bgColor="#DFEFFF"
%>
  <tr bgcolor="<%=bgColor%>">
    <td width="60"><%=iRs(0,i)%></td>
    <td width="150"><%=iRs(1,i)%></td>
    <td width="*"><%=left(iRs(2,i),20)%></td>
    <td width="150"><%=iRs(3,i)%></td>
  </tr><%
    Next 
End If
%>
</table>
<table width="760" border="0" cellspacing="2" cellpadding="2" align="center">
  <tr>
    <td>
<%ors.ShowPage()%>
</td>
  </tr> 
</table>
<table width="760" border="0" align="center" cellpadding="2" cellspacing="2">
  <tr>
    <td align="center">
      <%endtime=timer()%>
      本页面执行时间:<%=round((endtime-startime)*1000,3)%>&nbsp;毫秒</td>
  </tr>
</table>
</body>
</html>
<%
iRs=NULL
ors=NULL
Set ors=NoThing
%>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值