'计算总页数,并判断当前页的合法性
intTotalPage = int(AllCount/PageSize+.999)
if cint(CurrentPage) > cint(intTotalPage) then
CurrentPage = intTotalPage
end if
if cint(CurrentPage) < 1 then
CurrentPage = 1
end if
'跳至当前页
if not rs.EOF then
rs.MoveFirst
rs.PageSize = PageSize
rs.AbsolutePage = cint(CurrentPage)
end if
'获取本页的记录数
ProjNum = 0
Do Until rs.eof
ProjNum = ProjNum + 1
rs.MoveNext
if ProjNum = rs.PageSize then
Exit Do
end if
Loop
ProjCount = ProjNum
if ProjCount > 0 then rs.AbsolutePage = CurrentPage