'-----------------------首页-------------------------
if currentpage>1 then
firstlink = "<a href='" & url & pageparam & "1'>首页</a>"
prevlink = "<a href='" & url & pageparam & cstr(currentpage-1) & "'>上一页</a>"
else
firstlink = "首页"
prevlink = "上一页"
end if
'------------下一页----------------
if currentpage<pgcount then
nextlink = "<a href='" & url & pageparam & cstr(currentpage+1) & "'>下一页</a>"
lastlink = "<a href='" & url & pageparam & pgcount & "'>尾页</a>"
else
nextlink = "下一页"
lastlink = "尾页"
end if
pageinfomation = firstlink & seperator & prevlink & seperator & nextlink & seperator & lastlink & seperator & "每页" & cstr(int_pagesize) & "条记录" & seperator & "共" & pgcount & "页" & seperator & "目前第" & currentpage & "页" & seperator
response.write("<tr><td align=center>")
response.write("<table width='100%' border='1' cellpadding='2' cellspacing='2' bordercolor='#999999'>")
'---------------设置表头-----------------
response.write("<tr bgcolor='" & str_titlecolor & "'>")
dim i
for i=0 to fieldcount -1
response.write("<td align='center' width='" & arr_fieldwidth(i) & "'><font style='font-size:14px;'><b>" & arr_fieldname(i) & "</b></font></td>")
next
response.write("</tr>")
'---------------------输出内容---------------------------------
i=0
while (not obj_recordset.eof) and i<int_pagesize
dim cursor
response.write("<tr>")
for cursor = 0 to fieldcount -1
response.write("<td align='center'>" & obj_recordset(arr_field(cursor)) & "</td>")
next
response.write("</tr>")
i=i+1
obj_recordset.movenext
wend
'------------------------输出分页条------------------------------------
response.write("<tr><td align='right' colspan='" & cstr(fieldcount) & "'>" & pageinfomation & "</td></tr>")
response.write("</table></td></tr></table>")
end if
end sub
'----------检查参数是否正确---------------
private sub check()
if ubound(arr_field)<>ubound(arr_fieldname) then
str_error="fields数组和fieldname数组维数必须相同"
end if
if obj_recordset=empty then
str_error="数据源不能为空,请设置datasource属性"
end if
if int_pagesize="" then
str_error="数据源不能为空"
end if
showlasterror
end sub
end class