BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。怎么处理
ADODB.Field 错误 '80020009'
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/search.asp,行 0
<!--#include file="inc/config.asp"-->
<!--#include file="inc/conn.asp"-->
<%
page=request("page")
up_down=request.QueryString("up_down")
keyword=Server.HTMLEncode(request("keywords"))
Set rs=Server.CreateObject("Adodb.Recordset")
rs.open "select * from Article where title like '%"&keyword&"%' order by addtime desc",Conn,1,2
pgsz=15
if rs.recordcount=0 then
cur_page=1
total=1
session("count")=0
else
if isempty(session("cur_page")) or isNull(session("cur_page")) then
session("cur_page")=0
end if
cur_page=session("cur_page")
rs.pagesize=cint(pgsz)
if (rs.recordcount/pgsz)=INT(rs.recordcount/pgsz) then
total=INT(rs.recordcount/pgsz)
else
total=INT(rs.recordcount/pgsz)+1
end if
if page="" then
if len(up_down)=0 then
cur_page=1
end if
if up_down="up" then
cur_page=cur_page-1
end if
if up_down="down" then
cur_page=cur_page+1
end if
if cur_page>total then
cur_page=total
end if
if cur_page=0 then
cur_page=1
end if
else
cur_page=page
end if
session("count")=rs.recordcount
rs.absolutepage=cur_page
rowcount=rs.pagesize
end if
session("cur_page")=cur_page
session("total")=total
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>信息检索_<%=SiteName%></title>
<meta name="keywords" content="<%=rs("keywords")%>"/>
<meta name="description" content="<%=rs("description")%>"/>
<link rel="stylesheet" type="text/css" href="images/css/xiao5u.css" />
<script type="text/javascript" src="images/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="images/js/menu.js"></script>
</head>
<body>
<!--#include file="inc/head.asp"-->
<div class="mainbox">
<div class="mainnr bot1">
<div class="grayline ">
<div class="positionbg">
<div class="position bot10">当前位置:首页 >> 浏览信息</div>
</div>
<div class="sealist" style="font-size:14px;">
<ul>
<%
if rs.eof then
response.Write("<li>报歉!未找到符合条件的内容!</li>")
else
i=1
do while not rs.eof and i<=pgsz%> <li style="line-height:30px;"><a href="Article.asp?id=<%=rs("id")%>" target="_blank" title="<%=rs("title")%>"><%=rs("title")%></a> <%=rs("addtime")%> <p style="color:#008000"> Article.asp?id=<%=rs("id")%></p> </li>
<%
i=i+1
rs.movenext
loop
end if
%>
</ul>
</div>
</div>
<div class="clear-1"></div>
</div>
</div>
<%
rs.close
set rs=nothing
%>
<!--#include file="inc/bottom.asp"-->
</body>
</html>
麻烦大神
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/search.asp,行 0
<!--#include file="inc/config.asp"-->
<!--#include file="inc/conn.asp"-->
<%
page=request("page")
up_down=request.QueryString("up_down")
keyword=Server.HTMLEncode(request("keywords"))
Set rs=Server.CreateObject("Adodb.Recordset")
rs.open "select * from Article where title like '%"&keyword&"%' order by addtime desc",Conn,1,2
pgsz=15
if rs.recordcount=0 then
cur_page=1
total=1
session("count")=0
else
if isempty(session("cur_page")) or isNull(session("cur_page")) then
session("cur_page")=0
end if
cur_page=session("cur_page")
rs.pagesize=cint(pgsz)
if (rs.recordcount/pgsz)=INT(rs.recordcount/pgsz) then
total=INT(rs.recordcount/pgsz)
else
total=INT(rs.recordcount/pgsz)+1
end if
if page="" then
if len(up_down)=0 then
cur_page=1
end if
if up_down="up" then
cur_page=cur_page-1
end if
if up_down="down" then
cur_page=cur_page+1
end if
if cur_page>total then
cur_page=total
end if
if cur_page=0 then
cur_page=1
end if
else
cur_page=page
end if
session("count")=rs.recordcount
rs.absolutepage=cur_page
rowcount=rs.pagesize
end if
session("cur_page")=cur_page
session("total")=total
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>信息检索_<%=SiteName%></title>
<meta name="keywords" content="<%=rs("keywords")%>"/>
<meta name="description" content="<%=rs("description")%>"/>
<link rel="stylesheet" type="text/css" href="images/css/xiao5u.css" />
<script type="text/javascript" src="images/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="images/js/menu.js"></script>
</head>
<body>
<!--#include file="inc/head.asp"-->
<div class="mainbox">
<div class="mainnr bot1">
<div class="grayline ">
<div class="positionbg">
<div class="position bot10">当前位置:首页 >> 浏览信息</div>
</div>
<div class="sealist" style="font-size:14px;">
<ul>
<%
if rs.eof then
response.Write("<li>报歉!未找到符合条件的内容!</li>")
else
i=1
do while not rs.eof and i<=pgsz%> <li style="line-height:30px;"><a href="Article.asp?id=<%=rs("id")%>" target="_blank" title="<%=rs("title")%>"><%=rs("title")%></a> <%=rs("addtime")%> <p style="color:#008000"> Article.asp?id=<%=rs("id")%></p> </li>
<%
i=i+1
rs.movenext
loop
end if
%>
</ul>
</div>
</div>
<div class="clear-1"></div>
</div>
</div>
<%
rs.close
set rs=nothing
%>
<!--#include file="inc/bottom.asp"-->
</body>
</html>
麻烦大神
...全文
相关推荐
DreamWeaver做ASP程序时关于数据库的常见问题
另一个常见的错误是"ADODB.Field (0x800A0BCD)",提示"BOF 或 EOF 中有一个是‘真’,或者当前的记录已被删除,所需的操作要求一个当前的记录"。
ASP常见错误详解及解决方案小结-推荐第1(参考模板).pdf
ASP常见错误详解及解决方案小结:错误类型:ADODB.Field (0x800A0BCD)BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
asp.net BOF或EOF有一个是真,或者当前记录已被删除
总结来说,处理“ASP.NET BOF或EOF有一个是真,或者当前记录已被删除”的错误,关键在于检查Recordset是否为空以及正确处理空记录集的情况。
关于ASP eof与bof 区别分析
虽然名字中包含了"File",但在ASP中,它们更多地用来表示记录集的边界状态,而非文件的开头和结尾。1.
Delphi自动删除数据库中重复记录..rar
在处理重复记录时,一定要谨慎操作,避免误删重要数据,建议先备份数据再执行删除操作。


