帮忙分页问题
运行后错误信息:ADODB.Recordset '800a0bcd'
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
\wwwroot\search3.asp, line 13
以下为:search3.asp代码
<%
Sub ShowPage(objRS, PageNo)
response.write"<TABLE BORDER=1>"
Data = "<TR >"
'读取数据表的字段名称以作为表格的标题
For I = 0 To objRS.Fields.Count - 1
Data = Data & "<TH>" & objRS.Fields(I).Name & "</TH>"
Next
response.write Data &"</TR>"
objRS.AbsolutePage = PageNo
for I=1 TO objRS.pagesize
Data = "<TR>"
For J = 0 To objRS.Fields.Count - 1
Data = Data & "<TD>" & objRS.Fields(J).Value & "</TD>"
Next
Response.Write Data & "</TR>"
objRS.MoveNext
if objRS.EOF then Exit For
next
response.Write"</TABLE>"
End Sub
%>
<HTML><style type="text/css">
<!--
.style1 {color: #000000;font-size: 12px;font-family: "宋体";}
.style2 {font-size: 10px}
.style5 {color: #000000; font-size: 14px; font-family: "宋体";}
.style9 {color:#0033FF;font-size: 14px; font-family: "宋体"; }
.style10 {color: #003366}
.style11 {color: #003366; font-size: 14px; font-family: "宋体"; }
-->
</style>
<BODY class="style5">
<!-- #include file="../ADOFUNCTIONS.ASP" -->
<%
'使用Connection对象打开Access数据库 <stucj.mdb>
'定义SQL语句
Dim strSQL
strSQL = "SELECT * FROM stu_info WHERE " & request("Kind") & " like '" & request("Keyword ")& "'"
'从数据表中读取符合SQL美名的记录并存放在Recordset对象中
set objRS= GetSQLRecordset(strSQL, "../stucj.mdb", "stu_info")
objRS.pagesize =20
for I=1 To objRS.pageCount
response.write"<A HREF='search3.asp?Page="&I&"'>"&_
"第"&I&"页"&"</A>"&" "
next
PageNo =Request("Page")
if PageNo <> "" then
ShowPage objRS,PageNo
else
ShowPage objRS,1
end if
%>
</BODY>
</HTML>
[[it] 本帖最后由 ~@^@~ 于 2008-5-27 11:02 编辑 [/it]]