asp代码错误问题

来源:百度知道 编辑:UC知道 时间:2024/05/26 05:40:54
<%
dim exec,cn,i,j
j=10
exec="select * from Article"
set rs=server.createobject("adodb.recordset")
rs.open exec,cn,1,1
%>
<%
if rs.EOF and rs.BOF then
response.write("暂时还没有文章")
else
%><br>
<table border="0" width="814" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><table width="812" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="812" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="5">
<tr>
<td height

<%for i=0 to 10000
if Not rs.Eof Then %>
<tr>
<%for j=1 to 10%>
<td><% if not rs.eof then %>
<a href="Article_Show.asp?ArticleID=<%=rs("ArticleID")%>"><%=rs("title")%></a>
<% rs.movenext
end if%></td>
<% next%>
这个循环改成
<%
do while not rs.eof
%>
..
..
<%
rs.movenext
loop
%>

<%for j=1 to 10%>
<td><% if not rs.eof then %>
<a href="Article_Show.asp?ArticleID=<%=rs("ArticleID")%>"><%=rs("title")%></a>
<% rs.movenext
end if%></td>
<% next%>
执行完了这个以后可能已经是rs.eof了,再往后又一个rs.movenext就出错了。
不清楚为什么你要用两个循环。。。