Access2000数据库80万记录通用快速分页类__教程 |
|
日期:2007-5-20 1:26:37 人气:152 [大 中 小] |
|
|
|
Public Property Get arrRecordInfo() If Not sbooInitState Then Exit Property End If Dim rs, sql sql = "SELECT " & sstrFieldsList & _ " FROM " & sstrTableName & _ sstrCondiction & _ sstrOrderList Set rs = Server.CreateObject("Adodb.RecordSet") rs.open sql, sobjConn, 1, 1 If Not(rs.eof or rs.bof) Then rs.PageSize = sintPageSize rs.AbsolutePage = sintPageNow If Not(rs.eof or rs.bof) Then arrRecordInfo = rs.getrows(sintPageSize) Else arrRecordInfo = "" End If Else arrRecordInfo = "" End If rs.close Set rs = nothing End Property Rem ## 初始化记录数 Private Sub InitRecordCount() sintRecordCount = 0 If Not(sbooInitState) Then Exit Sub Dim sintTmp sintTmp = toNum(request.Cookies("_xp_" & sstrCookiesName), -1) If ((sintTmp < 0) Or (sintRefresh = 1))Then Dim sql, rs sql = "SELECT COUNT(" & sstrPrimaryKey & ")" & _ " FROM " & sstrTableName & _ sstrCondiction Set rs = sobjConn.execute(sql) If rs.eof or rs.bof Then sintTmp = 0 Else sintTmp = rs(0) End If sintRecordCount = sintTmp response.Cookies("_xp_" & sstrCookiesName) = sintTmp Else sintRecordCount = sintTmp End If End Sub Rem ## 初始化分页信息 Private Sub InitPageInfo() sstrPageInfo = "" If Not(sbooInitState) Then Exit Sub Dim surl surl = sstrPageUrl If Instr(1, surl, "?", 1) > 0 Then surl = surl & "&" & sstrPageVar & "=" Else surl = surl & "?" & sstrPageVar & "=" End If If sintPageNow <= 0 Then sintPageNow = 1 If sintRecordCount mod sintPageSize = 0 Then sintPageMax = sintRecordCount \ sintPageSize Else sintPageMax = sintRecordCount \ sintPageSize + 1 End If If sintPageNow > sintPageMax Then sintPageNow = sintPageMax |
|
出处:本站原创 作者:佚名 |
|
|