日期:2014-05-17  浏览次数:20895 次

求教。。修改内容。。
<table   width= "100% "   border= "0 "   cellspacing= "0 "   cellpadding= "0 ">
<%   set   rs=server.createobject( "ADODB.Recordset ")
sql   =   "SELECT   *   FROM   SmallClass   where   bigclasscn= ' "&trim(request( "bigclass "))& " ' "
rs.open   sql,conn3,1,1
for   i=1   to   8
  if   rs.eof   then   exit   for
  bigClasscn=rs( "bigClasscn ")
  SmallClasscn=rs( "SmallClasscn ")
  %>
  <tr>   <td>
<TABLE   cellSpacing=0   cellPadding=0   width= "100% "   border=0>
<TBODY> <TR>
<TD   background=images/newbg.jpg   height=25>
<TABLE   cellSpacing=0   cellPadding=0   width=550   border=0>
<TBODY> <TR>
<TD   width=23> &nbsp; </TD>
<TD   width=527> <a   href= "news.asp?bigclass= <%=   bigClasscn   %> &smallclass= <%=   SmallClasscn   %>   "> <%=   SmallClasscn   %> </A>
</TD> </TR> </TBODY> </TABLE>
</TD> </TR>
<TR> <TD>
<table   width= "100% "   border= "0 "   cellspacing= "0 "   cellpadding= "0 ">
<%   set   rs=server.createobject( "ADODB.Recordset ")
sql= "select   top   8   *   from   news   where   BigClassCN= ' "&trim(request( "bigclass "))& " '   and   SmallClassCN= ' "&trim(request( "bigclass "))& " '   order   by   newsid   desc "
rs.open   sql,conn3,1,1
for   i=1   to   8
if   rs.eof   then   exit   for
title=rs( "title ")
if   len(title)> 13   then   title=left(title,13)& ". "
%>  
<tr>
<td> &middot; <a   href= "news_view.asp?bigclass <%=   bigClasscn   %> =&smallclass= <%=   SmallClasscn   %> &newsid= <%=   rs( "newsid ")   %> "> <%=   rs( "title ")   %> </a> </td>
</tr>
<%   rs.movenext
next
rs.close
%>
</table>
</td> </tr>
<%   rs.movenext
next
rs.close
%> </table>

返回错误:
Microsoft   VBScript   编译器错误   错误   '800a0410 '  

循环控制变量   'for '   无效  

for   i=1   to   8
-----^


------解决方案--------------------
你连续两次都用 For i= ……
sql = "SELECT * FROM SmallClass where bigclasscn= ' "&trim(request( "bigclass "))& " ' "
rs.open sql,conn3,1,1
for i=1 to 8
if rs.eof then exit for

……

rs.open sql,conn3,1,1
for i=1 to 8
if rs.eof then exit for
title=rs( "title ")

……

<% rs.movenext
next
rs.close
%>
</table>
</td> </tr>
<% rs.movenext
next
rs.close
%>

你把前一个或后一个改成 j 或 k 或其它什么的,总之