asp的通用数据分页类(5)


        List_Fields=oFields
        Query_Where=oCondtion
        OrderBy_SQL=oOrderBy
        Set ExecuteBy=Execute()
    End Function
    '查询并返回当前CurPage的页码记录
    Public Function Execute()
        Call CloseRecordSet
        On Error Resume Next
        Dim TSQL,TopMod,sWhere
        If Not IsObject(Connection) Or Table_Name="" Or OrderBy_SQL="" Then
            Set Execute=Nothing
            Record_Count=0
            Page_Count=0
            Exit Function
        End If
        If Trim(Query_Where)<>"" Then 
            sWhere="Where "&Query_Where
        Else
            sWhere=""
        End If
        TSQL="Select Count(*) From ["&Table_Name&"] "&sWhere
        Record_Count=Connection.Execute(TSQL)(0)    '获取记录总数
        If Err Then
            Err.Clear
            Set Execute=Nothing
            Record_Count=0
            Page_Count=0
            Exit Function
        End If
        If Record_Count<1 Then
            Set Execute=Nothing
            Record_Count=0
            Page_Count=0
            Exit Function
        End If

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3048.html