Access 2000 数据库 80 万记录通用快速分页类(3)
End Property
Rem ## 当前页
Public Property Let intPageNow(Value)
sintPageNow = toNum(Value, 1)
End Property
Rem ## 页面参数
Public Property Let strPageVar(Value)
sstrPageVar = Value
End Property
Rem ## 是否刷新. 1 为刷新, 其他值则不刷新
Public Property Let intRefresh(Value)
sintRefresh = toNum(Value, 0)
End Property
Rem ## 获得当前页
Public Property Get intPageNow()
intPageNow = singPageNow
End Property
Rem ## 分页信息
Public Property Get strPageInfo()
strPageInfo = sstrPageInfo
End Property
Rem ## 取得记录集, 二维数组或字串, 在进行循环输出时必须用 IsArray() 判断
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 = ""
内容版权声明:除非注明,否则皆为本站原创文章。