| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 925 人关注过本帖
标题:[求助]BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要 ...
只看楼主 加入收藏
anrics
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-1-2
收藏
 问题点数:0 回复次数:3 
[求助]BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个

搜索出现错误:
ADODB.Field 错误 '800a0bcd'
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/Result.asp,行 207

下面是result.asp文件,第207行已经标出,不胜感激!

<%@ Language=VBScript%>

<!--#include file=include/conn.asp -->
<!--#include file=include/config.asp -->
<!--#include file="admin/char.inc"-->
<%
request_BigClassid=checkstr(Request("BigClassid"))
keyword=trim(checkstr(Request("keyword")))
keyword=replace(keyword,"'","")


PageShowSize = 10 '每页显示多少个页
MyPageSize = 20 '每页显示多少条

If Not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Or Request("page") <=0 Then
MyPage=1
Else
MyPage=Int(Abs(Request("page")))
End if

if keyword="" or keyword="关键字" then
%>
<script language=javascript>
history.back()
alert("请输入查询关键字!")
</script>
<body onload=javascript:window.close()></body>
<%
Response.End
end if
if request("action")="" then
findword="title like '%"&keyword&"%' or content like '%"&keyword&"%' or author like '%"&keyword&"%' or editor like '%"&keyword&"%' or about like '%"&keyword&"%'"
elseif request("action")="title" then
findword="title like '%"&keyword&"%' "
elseif request("action")="content" then
findword="content like '%"&keyword&"%' "
elseif request("action")="editor" then
findword="editor like '%"&keyword&"%' or author like '%"&keyword&"%' "
elseif request("action")="about" then
findword="about like '%"&keyword&"%' "
end if


set rs=server.CreateObject("ADODB.RecordSet")
rs.Source="select * from type order by typeorder"
rs.Open rs.Source,conn,1,1

dim ArraytypeID(10000),ArraytypeName(10000),Arraytypecontent(10000)
typeCount=rs.RecordCount
for i=1 to typeCount
ArraytypeID(i)=rs("typeID")
ArraytypeName(i)=rs("typeName")
Arraytypecontent(i)=rs("typecontent")
rs.MoveNext
next
rs.Close

%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>关键字:<%=keyword%>__搜索__<%=jjgn%></title>
<LINK href=txt.css rel=stylesheet>
</head>

<body topmargin="0" background="img/bg.gif">
<!--#include file=include/top1.asp -->
<table width="778" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc">
<tr valign="top">
<td width="200" bgcolor="#f4f4f4"><table width="94%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="IMAGES/kb.gif" width="1" height="8"></td>
</tr>
<tr>
<td valign="top">
<table width="90%" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" id="AutoNumber4" style="border: 1px solid #cccccc">
<tr>
<td width="100%" align=center><img src="img/type_left_02.gif" width="180" height="29"></td>
</tr>
<tr>
<td align=center><img name="" src="" width="1" height="8" alt=""></td>
</tr>
<tr>
<td align=center><%if search="1" then%>
<!--#include file=search.asp-->
<%else%>
<!--#include file=search1.asp-->
<%end if%></td>
</tr>
<tr>
<td align=center><img name="" src="" width="1" height="8" alt=""></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
</tr>
</table></td>
</tr>
</table></td>
<td bgcolor="#CCCCCC"><img name="" src="" width="1" height="1" alt=""></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#F4F4F4" ><img name="" src="" width="1" height="8" alt=""></td>
</tr>
<tr>
<td height="30" background="img/type_bg.gif" class="6"> <strong><font color="#FF00000">当前位置:</font></strong> <a class="daohang" href="./" >网站首页</a> - 搜索 - 关键字:<%=keyword%></b></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" id="AutoNumber3" style="border-collapse: collapse">
<tr>
<td></td>
</tr>
<tr>
<td><table border="0" cellpadding="3" cellspacing="0" width="100%">
<%set rs=server.CreateObject("ADODB.RecordSet")
if request_BigClassid<>"" then
if Request.cookies("key")="" then
rs.Source="select * from News where BigClassid=" & request_BigClassid &" and " & findword & " and checkked=1 and newslevel=0 order by NewsID DESC"
end if
if Request.cookies("key")="super" or Request.cookies("key")="typemaster" or Request.cookies("key")="bigmaster" or Request.cookies("key")="smallmaster" or Request.cookies("key")="check" then
rs.Source="select * from News where BigClassid=" & request_BigClassid &" and " & findword & " and checkked=1 order by NewsID DESC"
end if
if Request.cookies("key")="selfreg" then
if Request.cookies("reglevel")=3 then
rs.Source="select * from News where BigClassid=" & request_BigClassid &" and " & findword & " and checkked=1 and newslevel<=3 order by NewsID DESC"
end if
if Request.cookies("reglevel")=2 then
rs.Source="select * from News where BigClassid=" & request_BigClassid &" and " & findword & " and checkked=1 and newslevel<=2 order by NewsID DESC"
end if
if Request.cookies("reglevel")=1 then
rs.Source="select * from News where BigClassid=" & request_BigClassid &" and " & findword & " and checkked=1 and newslevel<=1 order by NewsID DESC"
end if
end if
else
if Request.cookies("key")="" then
rs.Source="select * from News where " & findword & " and checkked=1 and newslevel=0 order by NewsID DESC"
end if
if Request.cookies("key")="super" or Request.cookies("key")="typemaster" or Request.cookies("key")="bigmaster" or Request.cookies("key")="smallmaster" or Request.cookies("key")="check" then
rs.Source="select * from News where " & findword & " and checkked=1 order by NewsID DESC"
end if
if Request.cookies("key")="selfreg" then
if Request.cookies("reglevel")=3 then
rs.Source="select * from News where " & findword & " and checkked=1 and newslevel<=3 order by NewsID DESC"
end if
if Request.cookies("reglevel")=2 then
rs.Source="select * from News where " & findword & " and checkked=1 and newslevel<=2 order by NewsID DESC"
end if
if Request.cookies("reglevel")=1 then
rs.Source="select * from News where " & findword & " and checkked=1 and newslevel<=1 order by NewsID DESC"
end if
end if
end if


set rs=server.CreateObject("ADODB.RecordSet")
rs.Source="select * from it_News order by picname"
rs.Open rs.Source,conn,1,1


rs.PageSize=20
rs.CacheSize = RS.PageSize

for i=1 to rs.PageSize *( page-1)
if not rs.EOF then
rs.MoveNext
end if
next
Response.Write "<tr><td width=100% height=25 align=center >&nbsp;"
if rs.EOF then

Response.Write "<font color=red>抱歉,没有搜索到相关的资料!</font>"
else
rs.PageSize = MyPageSize
MaxPages = rs.PageCount
rs.absolutepage = MyPage
total = rs.RecordCount
Response.Write "共搜索到" & total & "条相关资料,当前第"& myPage &"/"& MaxPages &"页,每页"& rs.PageSize &"条"
end if
Response.Write "</td></tr>"


If Not rs.eof then
i = 0
do until rs.Eof or i = rs.PageSize
if rs("picname")<>"" then
img="<font color=red>[图]</font>"
else
img=""
end if
%>
<tr>
<%
title=trim(rs("title"))
title=replace(title,"<br>","")
dim bigclassid
bigclassid=rs("bigclassid")
set rs11=server.CreateObject("ADODB.RecordSet")
rs11.Source="select * from bigclass where bigclassid="&bigclassid&""
rs11.Open rs11.Source,conn,1,1
typeid=rs11("typeid") (第207行)
rs11.Close
dim mode
set rs12=server.CreateObject("ADODB.RecordSet")
rs12.Source="select * from type where typeid="&typeid&""
rs12.Open rs12.Source,conn,1,1
mode=rs12("mode")
rs12.Close

%>
<td width="100%" height="25" background="img/line.gif"> · <a class="middle" href="ReadNews.asp?NewsID=<%=rs("NewsID")%>" target=_blank title="<%=title%>">
<%if mode="2" then%>
<%=img%>
<%end if%>
<%if len(title)>30 then%>
<%=left(title,30)%>...
<%else%>
<%=title%>
<%end if%>
</font></a><font class=middle>(<%=rs("UpdateTime")%>)[<font color="#ff0000"><%=rs("click")%></font>]</font></td>
</tr>
<%

rs.MoveNext
i = i + 1
loop
%>
<tr>
<td width="100%" align=center>第 <%=Mypage%>/<%=Maxpages%> 页,每页
<%=MyPageSize%> 条
<%
url="Result.asp?action="&request("action")&"&keyword=" & keyword
PageNextSize=int((MyPage-1)/PageShowSize)+1
Pagetpage=int((total-1)/rs.PageSize)+1

if PageNextSize >1 then
PagePrev=PageShowSize*(PageNextSize-1)
Response.write "<a class=black href='" & Url & "&page=" & PagePrev & "' title='上" & PageShowSize & "页'>上一翻页</a> "
Response.write "<a class=black href='" & Url & "&page=1' title='第1页'>页首</a> "
end if
if MyPage-1 > 0 then
Prev_Page = MyPage - 1
Response.write "<a class=black href='" & Url & "&page=" & Prev_Page & "' title='第" & Prev_Page & "页'>上一页</a> "
end if

if Maxpages>=PageNextSize*PageShowSize then
PageSizeShow = PageShowSize
Else
PageSizeShow = Maxpages-PageShowSize*(PageNextSize-1)
End if
If PageSizeShow < 1 Then PageSizeShow = 1
for PageCounterSize=1 to PageSizeShow
PageLink = (PageCounterSize+PageNextSize*PageShowSize)-PageShowSize
if PageLink <> MyPage Then
Response.write "<a class=black href='" & Url & "&page=" & PageLink & "'>[" & PageLink & "]</a> "
else
Response.Write "<B>["& PageLink &"]</B> "
end if
If PageLink = MaxPages Then Exit for
Next

if Mypage+1 <=Pagetpage then
Next_Page = MyPage + 1
Response.write "<a class=black href='" & Url & "&page=" & Next_Page & "' title='第" & Next_Page & "页'>下一页</A>"
end if

if MaxPages > PageShowSize*PageNextSize then
PageNext = PageShowSize * PageNextSize + 1
Response.write " <A class=black href='" & Url & "&page=" & Pagetpage & "' title='第"& Pagetpage &"页'>页尾</A>"
Response.write " <a class=black href='" & Url & "&page=" & PageNext & "' title='下" & PageShowSize & "页'>下一翻页</a>"
End if


end if
rs.close
%>
</td>
</tr>
<tr>
</tr>
</table></td>
</tr>
<tr>
<td valign=top> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="1" bgcolor="#cccccc"><img name="" src="" width="1" height="1" alt=""></td>
</tr>
</table>
<!--#include file=include/bottom.asp -->
</body>
</html>

搜索更多相关主题的帖子: BOF 操作要求 EOF 记录 include 
2007-01-02 15:50
JavaEE5
Rank: 2
等 级:新手上路
威 望:4
帖 子:150
专家分:0
注 册:2006-12-24
收藏
得分:0 
"select * from bigclass where bigclassid="&bigclassid&""

数据库里没有相应的记录

我喜欢JavaEE5,虽然对此不了解。
2007-01-02 19:16
anrics
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-1-2
收藏
得分:0 
[求助]

多谢帮助.可是我的数据库里面有bigclass项,中间也包含有bigclassid

2007-01-03 13:52
hangxj
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2045
专家分:0
注 册:2006-4-10
收藏
得分:0 

记录为空,然后又没有做为空的时候的处理
改成下面的看看

set rs11=server.CreateObject("ADODB.RecordSet")
rs11.Source="select * from bigclass where bigclassid="&bigclassid&""
rs11.Open rs11.Source,conn,1,1

if rs11.eof or rs11.bof then
.........
else

typeid=rs11("typeid") (第207行)

end if
rs11.Close



http://www./
2007-01-03 15:58
快速回复:[求助]BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026790 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved