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


                Result=Result+Fields+ByString+","
            End If
        Next
        If Result<>"" Then Result=Left(Result,Len(Result)-1)
        TransformOrder=Result
    End Function
End Class


'示例代码:
Sub Show_List
    Dim Page,PageRs
    Page=Request("Page")
    Dim MyPage
    Set MyPage=New PageClass
    MyPage.Conn=Conn
    MyPage.PageSize=20
    MyPage.Page=Page
    MyPage.TableName="table1"
    MyPage.Fields="*"
    MyPage.OrderBy="ID Asc"
    Set PageRs=MyPage.Execute
    'Set PageRs=MyPage.ExecuteBy("table1","*","","ID Asc")
    If PageRs Is Nothing Then Exit Sub
    Do Until PageRs.Eof
        Response.Write " <tr bgcolor=""#FDFDFD"" style=""cursor:hand"" onmouseover=""this.style.background='#F3F3F3'"" onmouseout=""this.style.background='#FDFDFD'"">"
        Response.Write "    <td height=""20""><div align=""center"">"&PageRs("ID")&"</div></td>"
        Response.Write "    <td>"&PageRs("aaaa")&"</td>"
        Response.Write "    <td><a href="""&PageRs("bbbb")&"""><font color='#000000'>"&PageRs("bbbb")&"</font></a></td>"
        Response.Write "    <td>"&PageRs("cccc")&"</td>"
        Response.Write "  </tr>"
        PageRs.MoveNext
    Loop
    PageRs.Close
    PageCount=MyPage.PageCount
    Page=MyPage.Page            '取得当前正确的页码数
    NextPage=MyPage.NextPage
    PrePage=MyPage.PrePage
    Set PageRs=Nothing
    Set MyPage=Nothing
End Sub
Show_List
%> 




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

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