Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=employee.mdb"
//建立emp表的Recordset对象实例rs。
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "emp", conn, 3
PageSize = 10 //pagesize属性指定了每页要显示的记录条数
Page = CLng(Request("Page")) ’string型转化为long型
If Page < 1 Then Page = 1
If Page > rs.PageCount Then Page = rs.PageCount
If Page <> 1 Then
Response.Write "<A HREF=emp1.asp?Page=1>第一页</A>"
Response.Write "<A HREF=emp1.asp?Page=" & (Page-1) & ">上一页</A>"
End If
If Page <> rs.PageCount Then
Response.Write "<A HREF=emp1.asp?Page=" & (Page+1) & ">下一页</A>"
Response.Write "<A HREF=emp1.asp?Page="&rs.PageCount & ">最后一页</A>"
End If
Response.write"页码:" & Page & "/" & rs.PageCount & "</font>"
//每一页的显示
//显示表头
Response.Write "<CENTER><TABLE BORDER=1>