写一个涵数,参数就是当前的页码和每页几条数据,这是基本条件也可以在加一些其他条件
分页的显示页最好让在IFRAME里面显示,MAIN页向其传参数
如:
sub TableInit(cuPageNo,ipageSize) 'cuPageNo(前的页码)ipageSize(每页几条数据) rowNo = 0
if trim(ipageSize) = "" then
ipageSize = 10
end if
if trim(cuPageNo) = "" then
cuPageNo = 1
end if
strSql = "SELECT ^^^^^^"
set Rs=server.CreateObject("ADODB.recordset")
Rs.Open strSql,DBConn,3,1
if Rs.eof then
else
intCarCounts = rs.RecordCount
Rs.PageSize =ipageSize
if Rs.PageCount<cint(cuPageNo) then
Rs.AbsolutePage = 1
intcuPageNo = 1
else
Rs.AbsolutePage = cint(cuPageNo)
end if
intPageCounts = Rs.PageCount
do while ( not Rs.EOF and (cint(rowNo)<cint(ipageSize)) ) Response.Write "<tr align='center'>"
Response.Write "<td nowrap width=90>" & <Rs("SHARYO_NO") & "</td>" Response.Write "</tr>"
Rs.MoveNext
rowNo = rowNo + 1
loop
end if
Rs = nothing
end sub