[求助]BOF 或 EOF 中有一个是“真”
为什么我加入这显示时间的代码<span class="STYLE3"><%=rs("date")%></span>时就出现下面的错误,而删除这代码后就正常显示了??? 帮忙看看!错误类型:
ADODB.Field (0x80020009)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/blog/woyaodaili/daili.asp
代码如下:
<%
set rs=server.createobject("adodb.recordset")
page=request("page")
if page="" then page=1
if not(isnumeric(page)) then page=1
if page<1 then page=1
page=int(page)
sql="select * from daili order by date DESC"
rs.open sql,conn,3,1
if rs.eof and rs.bof then
%>
<tr bgcolor="#EEEEEE">
<td height="24" colspan="2" bgcolor="#FFFFFF">
<div align="center">
<font color="#FF0000" size="3">暂时没有招商信息!</font>
</div>
</td>
</tr>
<%
response.end
else
rs.pagesize=15
totalrec=rs.recordcount
totalpage=rs.pagecount
if page>totalpage then page=totalpage
rs.absolutepage=page
i=0
dim id(),dailiquyu(),dailimingcheng(),dailiren()
do while not rs.eof and (i<rs.pagesize)
i=i+1
redim preserve id(i),dailiquyu(i),dailimingcheng(i),dailiren(i)
id(i)=rs("id")
dailiquyu(i)=rs("dailiquyu")
dailimingcheng(i)=rs("dailimingcheng")
dailiren(i)=rs("dailiren")
rs.movenext
loop
end if
%>
<tr>
<td height="50" colspan="4" align="center" valign="middle"><span class="STYLE3">搜索关键字</span></td>
</tr>
<tr>
<td height="30" colspan="4" valign="middle" bgcolor="#9999FF"> <span class="STYLE3">代理区域</span> <span class="STYLE3">要求代理产品名称</span> <span class="STYLE3">代理人/公司</span> <span class="STYLE3">发布时间</span></td>
</tr>
<tr>
<%for i = 1 to ubound(id)%>
<td width="149" HEIGHT="36" align="left" valign="middle" bgcolor="#ffffff">
<span class="STYLE3">
<%=dailiquyu(i)%>
</span>
</td>
<td width="340" align="left" valign="middle" bgcolor="#FFFFFF" class="text">
<span class="STYLE3">
<a href="dailixx.asp?id=<%=id(i)%>">
<%=dailimingcheng(i)%>
</a>
</span><br>
<br>
</td>
<td width="212" valign="middle">
<span class="STYLE3"> <%=dailiren(i)%>
<br>
<br>
</span>
</td>
<td>
<span class="STYLE3"><%=rs("date")%></span>
</td>
<%a=a+1%>
<%if a>0 then %>
</tr>
<tr>
<%a=0%>
<%end if%>
<%next%>
</tr>
<tr align="center" valign="middle" bgcolor="#EFEFEF">
<td height="18" COLSPAN="6" align="center" valign="middle" bgcolor="#FFFFFF">
<form method=Post action="daili.asp">
<p align="center" class="STYLE3"> 共<%=totalpage%>页 第<%=page%>页
<%if page-1>0 then%>
<a href="daili.asp?page=<%=page-1%>">上一页</a>
<%else%>
上一页
<%end if%>
<%if page+1<=totalpage then%>
<a href="daili.asp?page=<%=page+1%>">下一页</a>
<%else%>
下一页
<%end if%>
<%
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 value="&page&">"
response.write " <input type='submit' value=' Goto ' name='cndok'></span></p>"
%></p>
</form>
</td>
</tr>
</table>
<table width="780" height="100" border="0" cellpadding="0" cellspacing="1">
<tr>
<td bgcolor="#6699FF">
<div align="center">广告
</div></td>
</tr>
</table>
</div>
<%
set rs=nothing
conn.close
set conn=nothing
%>