注册 登录
编程论坛 ASP技术论坛

高手帮忙看看是啥问题啊,加入循环语句就提示错误

vanhelsing 发布于 2008-01-06 14:56, 607 次点击
如下....问题出在什么地方了
<%
  set rs=server.CreateObject("adodb.recordset")
  sql="select top 1 * from news "
  rs.open sql,conn,1,1
%>
<%
if rs.EOF then
response.write "<tr><td>暂无旅游资讯信息!</td></tr>"
else
%>
 <%
do while NOT rs.eof
i=0
i=i+1
%>  
 <TABLE borderColor=#000000 height=12 cellSpacing=0 borderColorDark=#ffffff
      cellPadding=0 width=630 bgColor=#999900 border=1>
        <TBODY>
        <TR>
          <TD align=middle width=20 bgColor=#999900 height=10><B><FONT
            color=#ffffff size=1>&gt;&gt;&gt;</FONT></B><SPACER width="5" type="block"></TD>
          <TD class=xingcheng onmouseover="this.bgColor='#339900';"
          onmouseout="this.bgColor='#999900';" width=600 height=10>
            <TABLE class=xingcheng cellSpacing=0 cellPadding=0 width="100%"
            border=0>
              <TBODY>
              <TR>
                <TD style="CURSOR: hand" onclick=outliner() height=13
                color="#FFFF00" font
                  child="iALL"><%=rs("news_title")%></TD>
                <TD style="CURSOR: hand" onclick=outliner() align=right
                height=13 child="iALL">&nbsp;
        </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
      <DIV class=collapsed id=iALL align=center>
      <DIV onclick=outliner() align=center child="iALL1">
      <TABLE class=xingchengt height=195 cellSpacing=2 cellPadding=2 width=629
      border=0>
        <TBODY>
        <TR>
          <TD height=100>
           <%=rs("news_content")%>
        </P></TD></TR></TBODY></TABLE></DIV></DIV><BR>
      <%
rs.MoveNext
loop
end if
%>
2 回复
#2
yms1232008-01-06 15:58
do while NOT rs.eof
改成
do Until rs.eof
试试。
#3
madpbpl2008-01-06 20:00
楼主的程序测试通过,没问题的,具体报什么错呢?不会忘了加数据库链接文件了吧?
1