其中使用到一个分页类CPaging
复制代码 代码如下:
Class CPaging
Public RS ' RecordSet对象
Public Mark ' 指针标签
Private sSize ' 每页显示数
Private sTotal ' 总记录数
Private sPage ' 当前页码
Private sCount ' 总页码
Private Sub Class_Initialize
sSize = 20
sPage = 1
sCount = 1
End Sub
Private Sub Class_Terminate
Closeobj RS
End Sub
'每页显示数
Property Let Size(Value)
sSize = Value
End Property
Property Get Size
Size = sSize
End Property
'当前页码
Property Let Page(Value)
If Not IsNumeric(Value) Then
sPage = 1
Else
sPage = Value
End If
End Property
Property Get Page
If (sPage - 1) * sSize > sTotal Then
If sTotal Mod sSize = 0 Then
Page = Total \ sSize
Else
Page = Total \ sSize +1
End If
ElseIf sPage < 1 Then
Page = 1
Else
Page = sPage
End If
End Property
'总页码
Property Get Count
If sTotal Mod sSize = 0 Then
Count = sTotal \ sSize
Else
Count = sTotal \ sSize + 1
End If
End Property
'总记录数
Property Get Total()
Total = sTotal
End Property
Public Function Open(Byval SQLString)
Try DB.Openquery(RS,SQLString)
sTotal = RS.RecordCount
End Function
End Class
以下是调用页
复制代码 代码如下:
Dim Products
Set Products = New CPaging
With Products
.Size = 15 '每页显示数
.Page = PageNum '当前页
End With
Try Products.Open(ListSQL)
If Products.RS.Bof and Products.RS.Eof then
Response.Write("<TR><TD colspan=8>查找无记录</TD></TR>")
Else
Dim i
i = 0
Products.RS.Move (Products.Page - 1) * Products.Size
Do While Not Products.RS.Eof
Response.Write("<TR onmouseup=MouseUp(this); onmousedown=MouseDown(this); onmouseover=MouseOver(this); onclick=Click(this); onmouseout=MouseOut(this);>"&vbCrLf)
Response.Write("<TD align=middle nowrap>" & Products.RS("ProductsClassName") & "</TD>"&vbCrLf)
Response.Write("<TD align=left nowrap>" & Products.RS("ProductsName") & " </TD>"&vbCrLf)
Response.Write("</TR>"&vbCrLf)
i=i+1
If i >= Products.Size Then Exit Do
Products.RS.MoveNext
Loop
End If
当看到第8行的时候,似乎窥到了.net的影子--命名空间?
复制代码 代码如下:
Class CPaging
Public RS ' RecordSet对象
Public Mark ' 指针标签
Private sSize ' 每页显示数
Private sTotal ' 总记录数
Private sPage ' 当前页码
Private sCount ' 总页码
Private Sub Class_Initialize
sSize = 20
sPage = 1
sCount = 1
End Sub
Private Sub Class_Terminate
Closeobj RS
End Sub
'每页显示数
Property Let Size(Value)
sSize = Value
End Property
Property Get Size
Size = sSize
End Property
'当前页码
Property Let Page(Value)
If Not IsNumeric(Value) Then
sPage = 1
Else
sPage = Value
End If
End Property
Property Get Page
If (sPage - 1) * sSize > sTotal Then
If sTotal Mod sSize = 0 Then
Page = Total \ sSize
Else
Page = Total \ sSize +1
End If
ElseIf sPage < 1 Then
Page = 1
Else
Page = sPage
End If
End Property
'总页码
Property Get Count
If sTotal Mod sSize = 0 Then
Count = sTotal \ sSize
Else
Count = sTotal \ sSize + 1
End If
End Property
'总记录数
Property Get Total()
Total = sTotal
End Property
Public Function Open(Byval SQLString)
Try DB.Openquery(RS,SQLString)
sTotal = RS.RecordCount
End Function
End Class
以下是调用页
复制代码 代码如下:
Dim Products
Set Products = New CPaging
With Products
.Size = 15 '每页显示数
.Page = PageNum '当前页
End With
Try Products.Open(ListSQL)
If Products.RS.Bof and Products.RS.Eof then
Response.Write("<TR><TD colspan=8>查找无记录</TD></TR>")
Else
Dim i
i = 0
Products.RS.Move (Products.Page - 1) * Products.Size
Do While Not Products.RS.Eof
Response.Write("<TR onmouseup=MouseUp(this); onmousedown=MouseDown(this); onmouseover=MouseOver(this); onclick=Click(this); onmouseout=MouseOut(this);>"&vbCrLf)
Response.Write("<TD align=middle nowrap>" & Products.RS("ProductsClassName") & "</TD>"&vbCrLf)
Response.Write("<TD align=left nowrap>" & Products.RS("ProductsName") & " </TD>"&vbCrLf)
Response.Write("</TR>"&vbCrLf)
i=i+1
If i >= Products.Size Then Exit Do
Products.RS.MoveNext
Loop
End If
当看到第8行的时候,似乎窥到了.net的影子--命名空间?
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
更新日志
2024年11月18日
2024年11月18日
- 【雨果唱片】中国管弦乐《鹿回头》WAV
- APM亚流新世代《一起冒险》[FLAC/分轨][106.77MB]
- 崔健《飞狗》律冻文化[WAV+CUE][1.1G]
- 罗志祥《舞状元 (Explicit)》[320K/MP3][66.77MB]
- 尤雅.1997-幽雅精粹2CD【南方】【WAV+CUE】
- 张惠妹.2007-STAR(引进版)【EMI百代】【WAV+CUE】
- 群星.2008-LOVE情歌集VOL.8【正东】【WAV+CUE】
- 罗志祥《舞状元 (Explicit)》[FLAC/分轨][360.76MB]
- Tank《我不伟大,至少我能改变我。》[320K/MP3][160.41MB]
- Tank《我不伟大,至少我能改变我。》[FLAC/分轨][236.89MB]
- CD圣经推荐-夏韶声《谙2》SACD-ISO
- 钟镇涛-《百分百钟镇涛》首批限量版SACD-ISO
- 群星《继续微笑致敬许冠杰》[低速原抓WAV+CUE]
- 潘秀琼.2003-国语难忘金曲珍藏集【皇星全音】【WAV+CUE】
- 林东松.1997-2039玫瑰事件【宝丽金】【WAV+CUE】