<!--#include file=adovbs.inc -->
<html>
<body bgcolor=pink>
<%
session("flag")=9
set session("rs")=server.createObject("adodb.recordSet")
constr="provider=sqloledb;data source=XING-AE809AD14D;initial catalog=tx1;user id=sa;password=;"
session("rs").cursorlocation=aduseclient
sql="select * from t_student"
session("rs").open sql,constr,adopenkeyset,adlockreadonly,adcmdtext
%>
<table border="1" bordercolor="#000000" cellspacing="1" cellpadding="0" align="center">
<tr align=center valign=middle height=23>
<td><b>学号</b></td>
<td><b>姓名</b></td>
<td><b>性别</b></td>
<td><b>电话</b></td>
<td><b>籍贯</b></td>
<td><b>班级</b></td>
<td><b>民族</b></td>
</tr>
<%
session("start")=session("rs").absoluteposition
for j=0 to session("flag")-1
response.write "<tr align=center valign=middle>"
session("end")=session("rs").absoluteposition
for i=0 to session("rs").fields.count-1
response.write "<td>"&session("rs").fields(i).value&"</td>"
next
response.write "</tr>"
session("rs").moveNext
if session("rs").eof then
session("rs").movePrevious
exit for
response.write "</table>"
%>
<!--#include file=link.asp -->
link.asp 的代码:
<%response.Write "<br>数据总条数:"&session("rs").recordcount&""
if(session("rs").eof)or(session("end")>=session("rs").recordcount) then
response.write "[<a href=""query.asp?method=previous"">上一页</a>|"
response.write "下一页]"
elseif((session("rs").bof)or(session("start")=1)) then
response.write "[上一页|"
response.write "<a href=""query.asp?method=next"">下一页</a>]"
else
response.write "[<a href=""query.asp?method=previous"">上一页</a>|"
response.write "<a href=""query.asp?method=next"">下一页</a>]"
end if
response.Write "开始记录:"&session("start")&",结束记录:"&session("end")&"."
%>
我调试提示少了END,大家改下数据库就可以了