ADODB.Field 错误 '80020009' 分页显示错误

tksnow 2004-02-10 12:09:07
我的代码:

<!--#include file="OpenDb.inc"-->

<html>

<head>

</head>

<body>
<%

Set Conn=Server.CreateObject("ADODB.Connection")
Set Rs=Server.CreateObject ("ADODB.RecordSet")
Conn.Open (SqlOpenDb)
Search_Date=CDate(Request.Form("Search_Date"))

%>

<br>
<br>
<br>
<br>
<p align="center"><b><font face="华文新魏" style="font-size: 30pt" color="#FF00FF">
您查询计划单的记录如下:</font></b></p>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="80%" id="AutoNumber1" height="32">
<tr>
<td width="12%" height="18" align="center"><b>
<span style="font-family: 隶书"><font size="4">订单编码</font></span></b></td>
<td width="11%" height="18" align="center"><b>
<span style="font-family: 隶书"><font size="4">审核标志</font></span></b></td>
<td width="12%" height="18" align="center"><b>
<span style="font-family: 隶书"><font size="4">材料名称</font></span></b></td>
<td width="9%" height="18" align="center"><b>
<span style="font-family: 隶书"><font size="4">单位</font></span></b></td>
<td width="17%" height="18" align="center"><b>
<span style="font-family: 隶书"><font size="4">计划采购数量</font></span></b></td>
<td width="22%" height="18" align="center"><b>
<span style="font-family: 隶书"><font size="4">材料估计价格</font></span></b></td>
<td width="9%" height="18" align="center"><b><font size="4" face="隶书">审核</font></b></td>
<td width="8%" height="18" align="center"><b><font size="4" face="隶书">修改</font></b></td>
</tr>
<% Sql_Date="Select A.*,B.* ,C.* From OrderInfo A " & _
"Left Join ProductInfo B On A.OrderID=B.OrderID " & _
"Left Join MaterialInfo C On B.MaterialID=C.MaterialID " & _
"Where A.OrderDate='" & Search_Date & "' "

Rs.Open Sql_Date,Conn,3

If Rs.RecordCount>0 Then
Rs.PageSize=5
Page=Cint(Request("Page")) '当前页
If Page="" Then Page=1
If Page<1 Then Page=1
If Page>=Rs.PageCount Then Page=Rs.PageCount
Response.Write Page
Response.Write Rs.Pagecount
'Rs.AbsolutePage=Page
Response.Write Rs.AbsolutePage
End If

Dim i
Dim m
Dim n

If Page=1 Then
m=1
n=5
Else n=Page*5
m=n-4
If n>Rs.RecordCount Then n=Rs.RecordCount
End If

For i=m To n
%>
<tr>
<td width="12%" height="13">
 <%=Rs("OrderID")%>
</td>
<td width="11%" height="13">
<% If Rs("CensorFlag")<>0 Then
Response.Write "已审核"
Else Response.Write "未审核"
End If %>
</td>
<td width="12%" height="13"><%=Rs("MaterialName")%>
</td>
<td width="9%" height="13"><%=Rs("Unit")%></td>
<td width="17%" height="13"><%=Rs("PlantCount")%>
</td>
<td width="22%" height="13"><%=Rs("PlantPrice")%>
  元
</td>
<td width="9%" height="13">
<p align="center">
<input type="button" value="审核/反审核" name="Submits" onclick=window.location.href="Edit_Order.asp?OrderID=<%=Rs("OrderID")%>"
<% If Session("User") <> "b" Then %>
disabled
<% End If %>>
</td>
<td width="8%" height="13">
<form>
<input type="button" value="修 改" name="Submits" onclick=window.location.href="Edit_Order.asp?OrderID=<%=Rs("OrderID")%>"
<% If Session("User") <> "a" And Rs("CensorFlag")<>0 Then %>
disabled
<% End If %>>

</td>
</tr>
</p>
</form>

<%
If Rs.Eof Then Exit For
Rs.MoveNext
Next
%>
<tr>
<td width="100%" height="13" colspan="8">
<%
If Page>=1 Then
%><p align="right"><a href=Deal_SO.asp?Page=<% = Rs.AbsolutePage %>>第一页</a>   
<a href="Deal_SO.asp?Page=<% =Rs.AbsolutePage %>">上一页</a>   
<a href=Deal_SO.asp?Page=<% =Rs.AbsolutePage %>>下一页</a>   
<a href=Deal_SO.asp?Page=<% =Rs.AbsolutePage %>>最后一页</a>   
<% End If
%>
</td>
</tr>

<tr>
<td width="100%" height="13" colspan="8">
<p align="center"> 制单人:<%=Session("User")%></td>
</tr>
<%
Rs.Close
Set Rs=Nothing
Conn.Close
Set Conn=Nothing
%>
</table>
</center>
</div>
</body>
</html>
我做的分页显示,提示错误信息如下:
ADODB.Field 错误 '80020009'

BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。

/han/Deal_SO.asp,行 0

...全文
101 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧