| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 471 人关注过本帖
标题:[求助]我的代码哪里出错?
只看楼主 加入收藏
ouok8
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-1-2
收藏
 问题点数:0 回复次数:2 
[求助]我的代码哪里出错?

错误类型:
ADODB.Field (0x80020009)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/article/index.asp

以下是源码
<!--#include file="../conn/dbconn1.asp"-->
<!--#include file="../webconfig.asp"-->
<!--#include file="../top.asp"-->
<html><head><title><%=webname%>--技术文章</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../css/main.css" rel=stylesheet type=text/css>
<style type="text/css">
<!--
.S1 { FONT-SIZE: 12px
}
-->
</style>

<%
const Max=6
const Max1=8
const TjMax=18
const PicMax=1
const MaxNumber=5
%>
<span class="searchbar">
<%
set rssort=server.createobject("adodb.recordset")
sql="select * from articletype "
rssort.open sql,conn,1,1
%>
</span>
<CENTER>
<TABLE class=outborder cellSpacing=0 cellPadding=0 width=770 border=0>
<TBODY>
<TR>
<TD class=searchbar vAlign=top align=middle>文章分类:</TD>
<TD class=searchbar vAlign=top width=662>
<TABLE width="100%" border="0" cellpadding="0" cellspacing="0">
<TR>
<%j=1
do while not rssort.eof
%>
<td class=S1 vAlign=center align=middle width=636 height=20>&nbsp;<a href="#<%=rssort("typeid")%>" class=black><%=rssort("type")%></a> |</td>
<%if j mod 15 = 0 then %></tr><tr bgColor=#ffffff> <%end if%>
<% rssort.movenext
j=j+1
loop
rssort.close
set rssort=nothing
%>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
<TABLE class=searchdown height=27 cellSpacing=0 cellPadding=0 width=770
border=0>
<TBODY>
<TR>
<TD vAlign=bottom align=right height=30>
<TABLE width="98%" height="30" border=0 cellPadding=2 cellSpacing=0>
<SCRIPT LANGUAGE='JavaScript' SRC='../js/infosearch.js' TYPE='text/javascript'></script>
<FORM action="indexpro.asp" name=search_form onsubmit="javascript:if(doSearch()==false) return false;" method=post>
<TBODY>
<TR>
<TD width="25%" vAlign=center><INPUT name=txtitle size=28> </TD>
<TD width="12%" vAlign=center><select name=title>
<option selected
value=title>标题检索</option>
<option
value=content>全文检索</option>
</select></TD>
<TD width="10%" vAlign=center><a href="javascript:searchInCommunity()">
<select name="typeid" size="1" class=f11 style="width: 60; height: 20">
<option selected value="0">全部</option>
<%dim rs2,sql2,sel
set rs2=server.createobject("adodb.recordset")
sql2="select * from articletype"
rs2.open sql2,conn,1,1
do while not rs2.eof
if typeID=cstr(rs2("typeID")) then
sel="selected"
else
sel=""
response.write "<option " & sel & " value='" + Cstr(rs2("typeID")) + "'>" + rs2("type") + "</option>"
rs2.movenext
end if
loop
rs2.close
%>
</select>
</a></TD>
<TD width="13%" vAlign=center><input
name=I7 type=image src="images/club_index_200.gif" align=top width="65" height="22" border=0 ></TD>
<TD width="15%" vAlign=center><img height=19
src="images/club_index_203.gif" width=18 align=absMiddle> <a
href="/search/search.asp"><font
color=#ffffff>高级搜索</font></a></TD>
<TD width="25%" vAlign=center><span class="C"><font
color=#ffffff>合作频道:</font></span><a
href="" target="_blank"><font
color=#ffffff>商务会员 </font></a></TD>
</FORM>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
<br>
<TABLE cellSpacing=0 cellPadding=0 width=770 border=0>
<TBODY>
<TR>
<TD vAlign=top width=420>
<TABLE cellSpacing=0 cellPadding=0 width=420 border=0>
<TBODY>
<TR>
<TD width=143 background=""><IMG height=29
src="images/club_index_04.gif" width=143></TD>
<TD vAlign=center width=276 background=images/club_index_05.gif>
<MARQUEE height=10 id=clubnews onmouseout=clubnews.start() onmouseover=clubnews.stop() scrollAmount=3 scrollDelay=90 width="100%" align="middle">
<SPAN class=S1>
<%sql="select top 25 * from article where wzgg=0 and dateandtime>=date()-1 order by NewsID Desc"
set rs=conn.execute(sql)
if rs.eof then
response.write"暂无文章"
else
do while not rs.eof
response.write"<a href='shownews.asp?newsid="&rs("newsid")&"' target='_blank' class=white>"&rs("title")&"</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
rs.movenext
loop
end if%>
</SPAN></MARQUEE></TD>
<TD align=right width=3 background=images/club_index_05.gif><IMG
height=29 src="images/club_index_06.gif"
width=6></TD>
</TR>
</TBODY>
</TABLE>
<TABLE class=lh13
style="BORDER-RIGHT: #81cdff 1px solid; BORDER-LEFT: #81cdff 1px solid; BORDER-BOTTOM: #81cdff 1px solid"
cellSpacing=0 cellPadding=7 width=420 border=0>
<TBODY>
<TR>
<%
sql="select * from article where selectpic=1 and tjnews=1 order by NewsID desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
%>
<TD vAlign=top align=middle width=141 bgColor=#e3f0ff height=155><a href="shownews.asp?newsid=<%=rs("newsid")%>" target="_blank">
<img src="pic/<%=rs("picurl")%>" width=125 height=139 style="border: 0px solid #000000"></a></TD>
<TD vAlign=top width=282 bgColor=#e3f0ff>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class=lh15><IMG height=20
src="images/club_index_07.gif" width=20 align=absMiddle> <a href="shownews.asp?newsid=<%=rs("newsid")%>" target="_blank"><% if len(rs("title"))>14 then%><strong><%=left(rs("title"),13)%>..</strong><% else%><strong><%=rs("title")%></strong><%end if%></a> </TD>
</TR>
<TR>
<TD
class="S lh15">  <%=mid(rs("content"),1,90)%>……</TD>
</TR>
<TR>
<TD vAlign=bottom align=right><IMG height=19
src="images/club_index_09.gif" width=18 align=absMiddle> <A
class=S1
href="shownews.asp?newsid=<%=rs("newsid")%>" target="_blank">详细信息</A> </TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
</TD>
<TD vAlign=top width=15> </TD>
<TD vAlign=top width=315>
<TABLE cellSpacing=0 cellPadding=0 width=315 border=0>
<TBODY>
<TR>
<TD class=buttoncolor vAlign=center>
<TABLE height=17 cellSpacing=0 cellPadding=0 width="95%" border=0>
<TBODY>
<TR>
<TD class=white14 width="61%">今日文章 </TD>
<TD class=white align=right width="39%">今日更新 <%=zixun_datetime%> 条</TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
<TABLE class=blackbordernobottom cellSpacing=0 cellPadding=0 width=315
border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=#ffffff>
<TABLE class="lh15 buttonbottomborder" cellSpacing=0 cellPadding=4
width="100%" border=0>
<TBODY>
<TR>
<TD class=lh15 background=images/club_index_20.gif height=25>
<%sql="select top 2 * from article where tjnews=1 and selectpic=0 and homehot=0 and tjhome=0 order by NewsID Desc"
set rs=conn.execute(sql)
if rs.eof then
response.write"今日暂无最新文章"
else
do while not rs.eof
response.write"<a href='shownews.asp?newsid="&rs("newsid")&"' target='_blank'><b>"&rs("title")&"</b></a><br>"
rs.movenext
loop
end if%>
</TD>
</TR>
</TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class=nobianbuttonborder vAlign=top colSpan=10>&nbsp;<IMG height=22
src="images/club_index_18.gif" width=24 align=absMiddle> <FONT class=M>热门文章</FONT></TD>
</TR>
</TBODY>
</TABLE>
<TABLE class="lh15 buttonbottomborder" cellSpacing=0 cellPadding=5
width="100%" border=0>
<TBODY>
<TR>
<TD class=lh15 style="LINE-HEIGHT: 160%">
<%sql="select top 3 * from article order by hits Desc"
set rs=conn.execute(sql)
if rs.eof then
response.write"暂无文章"
else
do while not rs.eof
response.write"·<a href='shownews.asp?newsid="&rs("newsid")&"' target='_blank' class='s'>"&left(rs("title"),15)&"</a> (点击"&rs("hits")&"次)<br>"
rs.movenext
loop
end if%></TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
<div align="center">
<center>
<table width="770" border="1" cellspacing="1" bordercolor="#FFFFFF">
<tr>
<td align="center" valign="middle"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="770" height="85" align="absmiddle">
<param name="movie" value="../ads/picture/banner.swf">
<param name="quality" value="high">
<param name="" value="">
<embed src="../ads/picture/banner.swf" width="770" height="85" align="absmiddle" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" http://www.roome.cn=""></embed></object></td>
</tr>
</table>
</center>
</div>
<TABLE width=770 height="788" border=0 cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD class=blueborder vAlign=top align=middle width=200>
<TABLE class=buttonbar cellSpacing=0 cellPadding=0 width=200 border=0>
<TBODY>
<TR>
<TD><SPAN class=HEAD>图片文章</SPAN></TD>
</TR>
</TBODY>
</TABLE>
<BR>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class='s'>
<%
sql="select top 5 * from article where homehot=0 and selectpic=1 order by NewsID desc"
set rs=conn.execute(sql)
if rs.eof then
response.write" 暂无最新文章信息"
else
do while not rs.eof
response.write"<DIV align=center><a href='shownews.asp?newsid="&rs("newsid")&"' target='_blank'><img src='pic/"&rs("picurl")&"' width='150' height='150' hspace='5' vspace'5' class='porductborder'></a></div>"
response.write"<DIV align=center><a href='shownews.asp?newsid="&rs("newsid")&"' target='_blank' class='lh15'>"&left(rs("title"),13)&"</a></div><br> "
rs.movenext
loop
end if%>







</td>
</tr>
</table>
</TD>
<TD vAlign=top align=middle width=10> </TD>
<TD vAlign=top width=560>
<%
sql="select * from articletype "
set rstype=conn.execute(sql)
%>
<%do while not rstype.eof%>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width=278 height="136" vAlign=top>
<TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
<TBODY>
<TR>
<TD height=5><IMG height=17 src="images/club_index_21.gif"
width=17 align=absMiddle> <A name=<%=rstype("typeid")%>></a><a class="black M" href="indexpro.asp?typeid=<%=rstype("typeid")%>"><%=rstype("Type")%></a></TD>
</TR>
<TR>
<TD bgColor=#ff7300 height=3></TD>
</TR>
</TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR>
<TD align=left bgColor=#fafafa height=30>
<TABLE cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD class=S align=left><font color=red><b>[推荐]</b></font>
<%sql="select top 1 * from article where typeid="&rstype("typeid")&" and tjnews=1 order by NewsID Desc"
set rs=conn.execute(sql)
if rs.eof then
response.write" 暂无此栏目推荐文章"
else
do while not rs.eof
response.write"<a href='shownews.asp?newsid="&rs("newsid")&"' target='_blank' class=white>"&rs("title")&"</a>"
rs.movenext
loop
end if%></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
<TD bgColor=#e8e8e8 height=1></TD>
</TR>
</TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD style="PADDING-TOP: 5px" height=5>
<TABLE cellSpacing=0 cellPadding=2 width="100%">
<TBODY>
<TR>
<TD>
<%sql="select title,picurl,dateandtime,newsid from article where typeid="&rstype("typeid")&" and tjhome=0 order by NewsID desc"
set rs=conn.execute(sql)
%>
<%sql="select top 10 title,picurl,dateandtime,newsid from article where typeid="&rstype("typeid&")&" and tjhome=0 order by NewsID desc"
set rs=conn.execute(sql)
if rs.eof then
response.write" 暂无最新文章信息"
else
do while not rs.eof
response.write"·<a href='shownews.asp?newsid="&rs("newsid")&"' target='_blank' class='lh15'>"&left(rs("title"),14)&"</a> <FONT class=S1 color=#666666>("&month(rs("dateandtime"))&"-"&day(rs("dateandtime"))&")</font><br> "
num=num+1
if num>=MaxNumber then exit do
rs.movenext
loop
end if%></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
<TD align=right height=25><IMG height=19
src="images/club_index_22.gif" width=18 align=absMiddle> <A
class=s
href="indexpro.asp?typeid=<%=rstype("typeid")%>">更多</A>&nbsp;&nbsp;</TD>
</TR>
</TBODY>
</TABLE>
</TD>
<TD width=1 bgColor=#d5d5d5></TD>
<%rstype.movenext%>
<TD vAlign=top width=278>
<TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
<TBODY>
<TR>
<TD height=5><IMG height=17 src="images/club_index_21.gif"
width=17 align=absMiddle> <A name=<%=rstype("typeid")%>></a><a class="black M" href="indexpro.asp?typeid=<%=rstype("typeid")%>"><%=rstype("Type")%></a></TD>
</TR>
<TR>
<TD bgColor=#ff7300 height=3></TD>
</TR>
</TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR>
<TD align=left bgColor=#fafafa height=30>
<TABLE cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD class=S align=left><font color=red><b>[推荐]</b></font>
<%sql="select top 1 * from article where typeid="&rstype("typeid")&" and tjnews=1 order by NewsID Desc"
set rs=conn.execute(sql)
if rs.eof then
response.write" 暂无此栏目推荐文章"
else
do while not rs.eof
response.write"<a href='shownews.asp?newsid="&rs("newsid")&"' target='_blank' class=white>"&rs("title")&"</a>"
rs.movenext
loop
end if%></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
<TD bgColor=#e8e8e8 height=1></TD>
</TR>
</TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD style="PADDING-TOP: 5px" height=5>
<TABLE cellSpacing=0 cellPadding=2 width="100%">
<TBODY>
<TR>
<TD>
<%sql="select title,picurl,dateandtime,newsid from article where typeid="&rstype("typeid")&" and tjhome=0 order by NewsID desc"
set rs=conn.execute(sql)
%>
<%sql="select top 10 title,picurl,dateandtime,newsid from article where typeid="&rstype("typeid&")&" and tjhome=0 order by NewsID desc"
set rs=conn.execute(sql)
if rs.eof then
response.write" 暂无最新文章信息"
else
do while not rs.eof
response.write"·<a href='shownews.asp?newsid="&rs("newsid")&"' target='_blank' class='lh15'>"&left(rs("title"),14)&"</a> <FONT class=S1 color=#666666>("&month(rs("dateandtime"))&"-"&day(rs("dateandtime"))&")</font><br> "
num1=num1+1
if num1>=MaxNumber then exit do
rs.movenext
loop
end if%></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
<TD align=right height=25><IMG height=19
src="images/club_index_22.gif" width=18 align=absMiddle> <A
class=s
href="indexpro.asp?typeid=<%=rstype("typeid")%>">更多</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TBODY>
</TABLE> </TD>
</TR>
</TBODY>
</TABLE>
<%
rstype.movenext
loop
%>
</TD>
</TR>
</TBODY>
</TABLE>
<div align="center">
<table width="770" border="0" cellpadding="0" bgcolor="B6D8FE">
<tr>
<td width="100%" height="3">
</td>
</tr>
</table>
</div>
</CENTER>
<!--#include file="../webfoot.asp"-->

搜索更多相关主题的帖子: 代码 
2006-01-02 16:04
dfm2005
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2005-12-29
收藏
得分:0 

问题应该是在某处数据为空,你看看哪里数据没检查not rs.eof的情况。
太乱了,我没注意看。

2006-01-05 17:04
anjincheng
Rank: 2
等 级:论坛游民
威 望:5
帖 子:728
专家分:31
注 册:2005-7-27
收藏
得分:0 
我也看不清楚

但是,如果是保存页面,你看看数据库里的属性和代码里的字段是否对应。

比如你数据库里有

AAABA

你在保存页面(add_*****.asp)里获取的AAABA是否是AAABA。

我是农家的孩子,我有农家孩子的本色!
2006-01-05 18:52
快速回复:[求助]我的代码哪里出错?
数据加载中...
 
   



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

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