VB代码错误—无效的 'exit' 语句

来源:百度知道 编辑:UC知道 时间:2024/05/18 07:44:12
Microsoft VBScript 编译器错误 '800a040f'
无效的 'exit' 语句
\admin\Calendar.asp, line 77

line 77 是“if rs.eof then exit do”(第二个)

代码如下:

<!--#include file="conn.asp"-->
<%
id=request.querystring("id")
Sql="select * from table where id="&id
rs.open Sql,conn,1,1
if rs.eof then response.end
%>
.........'代码若干
<% i=1
do while i<=4
%>
.........'代码若干
<%
i=i+1
rs.movenext
if rs.eof then exit do
loop
%>
.........'代码若干
<%
if rs.eof then exit do
loop
rs.close
%>

请大虾指点。
感谢zxlxxl和iqcard两位朋友的回答,iqcard的我想到了,改成那样后又出来了个问题,提示:“语法错误 (操作符丢失) 在查询表达式 'id=' 中。 line 37”(line 37 为:Sql="select * from table where id="&id )
我把这句改为:Sql="select * from table"
之后倒是没有错误提示了。但是原本我是想要查询并输出数据

修改过了,&前后要加空格,实在不行就这样
Sql="select * from table where id=" & request.querystring("id")

-----------

<!--#include file="conn.asp"-->
<%
id=request.querystring("id")
Sql="select * from table where id=" & id
rs.open Sql,conn,1,1
if rs.eof then response.end
%>
.........'代码若干
<% i=1
do while i<=4
%>
.........'代码若干
<%
i=i+1
rs.movenext
%>
.........'代码若干
<%
if rs.eof then exit do
loop
rs.close
%>

怎么只看到一个Do While 两个Loop