Access 2000 数据库 80 万记录通用快速分页类[转帖]
2005-01-18 13:01
417 查看
主要思路: 用一条语句统计(Count)出记录数(而不在查询时获得 RecordCount 属性), 缓存在 Cookies 中, 跳转时就不用再次统计. 使用 ADO 的 AbsolutePage 属性进行页面跳转即可. 为方便调用而写成类, 代码主要地方已有说明
硬件环境: AMD Athlon XP 2600+, 256 DDR
软件环境: MS Windows 2000 Advanced Server + IIS 5.0 + Access 2000 + IE 6.0
测试结果: 初次运行在 250(首页) - 400(末页)毫秒, (记录数缓存后)在页面间跳转稳定在 47 毫秒以下.第1页跳到最后一页不多于 350 毫秒
适用范围: 用于普通分页. 不适用于有较复杂的查询时: 如条件为"[Title] Like '%最爱%'", 查询的时间大大增加, 就算 Title 字段作了索引也没用. :(
硬件环境: AMD Athlon XP 2600+, 256 DDR
软件环境: MS Windows 2000 Advanced Server + IIS 5.0 + Access 2000 + IE 6.0
测试结果: 初次运行在 250(首页) - 400(末页)毫秒, (记录数缓存后)在页面间跳转稳定在 47 毫秒以下.第1页跳到最后一页不多于 350 毫秒
适用范围: 用于普通分页. 不适用于有较复杂的查询时: 如条件为"[Title] Like '%最爱%'", 查询的时间大大增加, 就算 Title 字段作了索引也没用. :(
%@LANGUAGE % % % % intDateStart intDateStart f__OpenConn strDbPath connstr strDbPath connstr connstr connstr strDbPath conn conn connstr f__CloseConn conn conn conn nothing getTimeOveriflag tTimeOver iflag tTimeOver intDateStart true getTimeOver tTimeOver tTimeOver intDateStart true getTimeOver tTimeOver Cls_PageView sbooInitState sstrCookiesName sstrPageUrl sstrPageVar sstrTableName sstrFieldsList sstrCondiction sstrOrderList sstrPrimaryKey sintRefresh sintRecordCount sintPageSize sintPageNow sintPageMax sobjConn sstrPageInfo Class_Initialize ClearVars class_terminate sobjConn nothing ClearVars sbooInitState False sstrCookiesName sstrPageUrl sstrPageVar sstrTableName sstrFieldsList sstrCondiction sstrOrderList sstrPrimaryKey sintRefresh sintRecordCount sintPageSize sintPageNow sintPageMax strCookiesName sstrCookiesName strPageUrl sstrPageUrl strTableName sstrTableName strFieldsList sstrFieldsList strCondiction sstrCondiction sstrCondiction strOrderList sstrOrderList sstrOrderList strPrimaryKey sstrPrimaryKey intPageSize sintPageSize toNum objConn sobjConn intPageNow sintPageNow toNum strPageVar sstrPageVar intRefresh sintRefresh toNum intPageNow intPageNow singPageNow strPageInfo strPageInfo sstrPageInfo arrRecordInfo sbooInitState rs sql sql sstrFieldsList _ sstrTableName _ sstrCondiction _ sstrOrderList rs rs sql sobjConn rseof rsbof rsPageSize sintPageSize rsAbsolutePage sintPageNow rseof rsbof arrRecordInfo rsgetrowssintPageSize arrRecordInfo arrRecordInfo rs rs nothing InitRecordCount sintRecordCount sbooInitState sintTmp sintTmp toNum sstrCookiesName -1 sintTmp sintRefresh sql rs sql sstrPrimaryKey _ sstrTableName _ sstrCondiction rs sobjConnsql rseof rsbof sintTmp sintTmp rs sintRecordCount sintTmp sstrCookiesName sintTmp sintRecordCount sintTmp InitPageInfo sstrPageInfo sbooInitState surl surl sstrPageUrl surl surl surl sstrPageVar surl surl sstrPageVar sintPageNow sintPageNow sintRecordCount sintPageSize sintPageMax sintRecordCount sintPageSize sintPageMax sintRecordCount sintPageSize sintPageNow sintPageMax sintPageNow sintPageMax sintPageNow sstrPageInfo sstrPageInfo sstrPageInfo surl sstrPageInfo sstrPageInfo surl sintPageNow sintPageMax sintPageNow sstrPageInfo sstrPageInfo sstrPageInfo sstrPageInfo surl sintPageNow sstrPageInfo sstrPageInfo surl sintPageMax sstrPageInfo sstrPageInfo sintPageNow sintPageMax sstrPageInfo sstrPageInfo sintRecordCount sintPageSize toNums Default s s s s toNum s toNum Default InitClass sbooInitState True sobjConn sbooInitState False InitRecordCount InitPageInfo strLocalUrl strLocalUrl intPageNow intPageNow intPageSize strPageInfo intPageSize arrRecordInfo i Conn f__OpenConn clsRecordInfo clsRecordInfo New Cls_PageView clsRecordInfostrTableName clsRecordInfostrPageUrl strLocalUrl clsRecordInfostrFieldsList clsRecordInfostrCondiction clsRecordInfostrOrderList clsRecordInfostrPrimaryKey clsRecordInfointPageSize clsRecordInfointPageNow intPageNow clsRecordInfostrCookiesName clsRecordInfostrPageVar clsRecordInfointRefresh clsRecordInfoobjConn Conn clsRecordInfoInitClass arrRecordInfo clsRecordInfoarrRecordInfo strPageInfo clsRecordInfostrPageInfo clsRecordInfo nothing f__CloseConn % html head meta http-equiv content title分页测试/title style type !-- PageView { font-size ; } PageView td { border-right-style solid; border-bottom-style solid; border-right-color #E0E0E0; border-bottom-color #E0E0E0; border-right-width ; border-bottom-width ; } PageView table { border-left-style solid; border-top-style solid; border-left-color #E0E0E0; border-top-color #E0E0E0; border-top-width ; border-left-width ; } trHeader { background #EFF7FF; font-size ; font-weight bold; line-height %; text-align center; } -- /style style type !-- body { font-size ; } alink { color #993300; text-decoration none; } avisited { color #003366; text-decoration none; } ahover { color #0066CC; text-decoration underline; } aactive { color #000000; text-decoration none; } table { font-size ; } -- /style /head body table width border cellspacing cellpadding tr tdnbsp;% strPageInfo%/td /tr /table div table width border cellspacing cellpadding tr tdID/td td描述/td td日期/td /tr % arrRecordInfo i to arrRecordInfo % tr tdnbsp;% arrRecordInfo i%/td tdnbsp;% arrRecordInfo i%/td tdnbsp;% arrRecordInfo i%/td /tr % % /table /div table width border cellspacing cellpadding tr tdnbsp;% strPageInfo%/td /tr /table table width border cellspacing cellpadding tr td alignnbsp;% getTimeOver%/td /tr /table /body /html 转自:http://blog.csdn.net/xiaoyuehen/archive/2005/01/17/257202.aspx
相关文章推荐
- Access 2000 数据库 80 万记录通用快速分页类
- Access 2000 数据库 80 万记录通用快速分页类
- Access 2000 数据库 80 万记录通用快速分页类
- (转帖)在MsSql、Access两种数据库中插入记录后马上得到自动编号的ID值
- 回复:在MsSql、Access两种数据库中插入记录后马上得到自动编号的ID值
- 如何从Access 2000中表删除重复记录
- asp 连接数据库 Sql 2000 与 Access 的连接方法
- asp+access 怎样才能随机抽数据库中的记录?
- Access2000数据库80万记录通用快速分页类
- Asp+access,如何统计 数据库里的记录条数?(
- 向SQL Server 2000数据库添加Image数据类型记录
- 通过试验探索 Access 2000/XP 数据库的最佳 NTFS 权限设置
- 八步解决ACCESS自动编号问题,SERVER 2000数据库,转换为ACCESS数据库
- Mysql,access,mssql server三种数据库获得新插入记录id的方法
- Access 2000 数据库密码格式
- SQL SERVER 2000数据库,转换为ACCESS数据库(已解决ACCESS自动编号问题)
- 八步解决ACCESS自动编号问题,SERVER 2000数据库,转换为ACCESS数据库
- 转帖:MS SQL Server 2000 数据库使用备份还原造成的孤立用户和对象名‘xxx’无效的错误的解决办法
- 基于数据库(access)层次编码记录对TreeView的操作(实现自动编码,灵活控制编码规则和编码层次)