<%
dim t,j,i,k
set rs1=server.createobject("ADODB.Recordset")
sql1="select * from p_news where agree=1 and check=1 order by id desc"
rs1.open sql1,conn,1,1
if rs1.eof or rs1.bof then
%>
<tr>
<td width="159"><font color="#454545"><img border="0" src="IMAGE/A17.gif" width="9" height="8"> 暂时没有任何纪录</font></td>
</tr>
<%
else
set rs2=server.createobject("ADODB.Recordset")
sql2="select * from p_news where agree=1 and top=1 and check=1 order by id desc"
rs2.open sql2,conn,1,1
if rs2.eof or rs2.bof then
t=1
do while not rs1.eof
%>
<tr>
<td width="159"><img border="0" src="IMAGE/A17.gif" width="9" height="8"> <a href="news.asp?id=<%=rs1("id")%>"><font color="#454545"><%=left(rs1("title"),12)%></font></a></td>
<%
if rs1.eof then
exit do
end if
rs1.movenext
t=t+1
%>
<td width="159"><img border="0" src="IMAGE/A17.gif" width="9" height="8"> <a href="news.asp?id=<%=rs1("id")%>"><font color="#454545"><%=left(rs1("title"),12)%></font></a></td>
</tr>
<%
if t>=20 then
exit do
end if
if rs1.eof then
exit do
end if
rs1.movenext
t=t+1
loop
else
j=1
do while not rs2.eof
%>
<tr>
<td width="159"><img border="0" src="IMAGE/A17.gif" width="9" height="8"> <a href="news.asp?id=<%=rs2("id")%>"><font color="#454545"><%=left(rs2("title"),12)%></font></a></td>
<%
if rs2.eof then
exit do
end if
rs2.movenext
j=j+1
%>
<td width="159"><img border="0" src="IMAGE/A17.gif" width="9" height="8"> <a href="news.asp?id=<%=rs2("id")%>"><font color="#454545"><%=left(rs2("title"),12)%></font></a></td>
</tr>
<%
if rs2.eof then
exit do
end if
if j>=20 then
exit do
end if
rs2.movenext
j=j+1
loop
if j < 20 then
i= (20-j)
if i=1 then
%>
<td width="159"><img border="0" src="IMAGE/A17.gif" width="9" height="8"> <a href="news.asp?id=<%=rs1("id")%>"><font color="#454545"><%=left(rs1("title"),12)%></font></a></td>
</tr>
<%
elseif i mod 2=0 then
k=1
do while not rs1.eof
%>
<tr>
<td width="159"><img border="0" src="IMAGE/A17.gif" width="9" height="8"> <a href="news.asp?id=<%=rs1("id")%>"><font color="#454545"><%=left(rs1("title"),12)%></font></a></td>
<%
if rs1.eof then
exit do
end if
rs1.movenext
k=k+1
%>
<td width="159"><img border="0" src="IMAGE/A17.gif" width="9" height="8"> <a href="news.asp?id=<%=rs1("id")%>"><font color="#454545"><%=left(rs1("title"),12)%></font></a></td>
</tr>
<%
if k>=i then
exit do
end if
if rs1.eof then
exit do
end if
rs1.movenext
k=k+1
loop
elseif i mod 2=1 and i<>1 then
k=1
do while not rs1.eof
%>
<td width="159"><img border="0" src="IMAGE/A17.gif" width="9" height="8"> <a href="news.asp?id=<%=rs1("id")%>"><font color="#454545"><%=left(rs1("title"),12)%></font></a></td>
</tr>
<%
if rs1.eof then
exit do
end if
rs1.movenext
k=k+1
%>
<tr>
<td width="159"><img border="0" src="IMAGE/A17.gif" width="9" height="8"> <a href="news.asp?id=<%=rs1("id")%>"><font color="#454545"><%=left(rs1("title"),12)%></font></a></td>
<%
if k>=i-1 then
exit do
end if
if rs1.eof then
exit do
end if
rs1.movenext
k=k+1
loop
rs1.movenext
%>
<td width="159"><img border="0" src="IMAGE/A17.gif" width="9" height="8"> <a href="news.asp?id=<%=rs1("id")%>"><font color="#454545"><%=left(rs1("title"),12)%></font></a></td>
</tr>
<%
else
response.Write "系统出错!请尽快处理"
end if
end if
end if
rs2.close
set rs2=nothing
end if
rs1.close
set rs1=nothing
%>
错误类型:
ADODB.Field (0x80020009)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。