<head>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:\Inetpub\wwwroot\left1\db\IPaddress.mdb"
Set rs=Server.CreateObject("ADODB.Recordset")
rs.CursorType=AdOpenDynamic
rs.Open "select * from dv_address",conn
Response.Write("命令已执行!")
rs.PageSize=4
Page=Clng(Request("Page"))
If Page < 1 Then Page=1
If Page > 1 Then Page=rs.PageCount
%>
</head>
<body>
<table border="1">
<tr>
<td>序号</td>
<%
for i=0 to rs.Fields.Count-1
Response.Write("<td>" & rs.fields(i).name & "</td>")
next
%>
</tr>
<%
rs.absolutepage=page
for iPage =1 to rs.PageSize
RecNo = (Page-1)*rs.PageSize + iPage
%>
<tr>
<td><%=RecNo%></td>
<%Do While not rs.eof%>
<td><%=rs("ip1")%></td>
<td><%=rs("ip2")%></td>
<td><%=rs("country")%></td>
<td><%=rs("city")%></td>
</tr>
<%
rs.movenext
loop
next
%>
</table>
<p align="center">
<%
If Page <> 1 Then
Response.Write "<A HREF=sql.asp?Page=1>第一页</A> "
Response.Write "<A HREF=sql.asp?Page="& (Page-1) &">上一页</A> "
End If
If Page <>rs.PageCount Then
Response.Write "<A HREF=sql.asp?Page="& (Page+1) &">下一页</A> "
Response.Write "<A HREF=sql.asp?Page="& rs.PageCount &">最后一页</A> "
End If
%>
<p align="center">页数:<%=Page%>/<%=rs.PageCount%></p>
<%
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
</body>
红色那行是错误?小弟是新手,请各位大哥多帮忙!