我帮你做了一个,自己修改一下链接吧:
<body>
<p>
<%
Dim conn,rs
Dim connstr
Dim sqlCmd
Dim pages
if(Request.QueryString("pages")<>"") then
pages=Cint(Request.QueryString("pages"))
if(pages<1) then
pages=1
Response.Redirect("index.asp?pages=1")
end if
else
pages=1
end if
set conn = server.createobject("adodb.connection")
conn.open = "provider=microsoft.jet.oledb.4.0;" & "data source = " & server.mappath("DataBase/data.mdb")
set rs= server.createobject("adodb.recordset")
if pages<>1 then
rs.open "select Top 10 * from test where id not in(select Top "&(pages-1)*10&" id from test order by id) order by id",conn,1,2
else
rs.open "select Top 10 * from test order by id",conn,1,2
end if
if rs.recordcount<>0 then
response.Write("<table cellspacing='0' cellpadding='4' rules='all' border='1' id='GridView1' style='color:#333333;border-collapse:collapse;'>")
response.Write("<tr style='color:White;background-color:#1C5E55;font-weight:bold;'>")
for each it in rs.fields
Response.Write("<th>"&it.name&"</th>")
next
response.Write("</tr>")
dim arr
arr = rs.GetRows()
'arr(0,2)="ssssss"
For row = 0 To UBound(arr, 2)
response.Write("<tr>")
For col = 0 To UBound(arr, 1)
Response.Write ("<td>"&arr(col, row) & "</td>")
Next
response.Write("</tr>")
Next
response.Write("</table>")
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
</p>
<form action="index.asp" method="get"><a href='index.asp?pages=<%=(pages-1)%>'>上一页</a>
<a href='index.asp?pages=<%=(pages+1)%>'>下一页</a>
<input name="pages" value="<%=pages%>" style="width:30px" type="text">
<input value="GO" type="submit">
</form>
</body>