为什么我的程序提示'loop' 语句缺少 'do'? 怎么解决呀
<%
UserName = request.form("UserName")
UserPwd = request.form("UserPwd")
If UserName = "" Then
Errmsg = "请输入用户名和密码"
Else
'=============连接数据库===============
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.ConnectionString="driver={SQL Server};server=localhost;UID=sa;PWD=;Database=GjjChaxun"
'连接数据库
Conn.Open
'============从表Users中读取用户数据==============
'定义Recordset对象
Set rs=Server.CreateObject("ADODB.Recordset")
'设置Connection对象的ConnectionString
'设置rs的ActiveConnection属性,绑定到连接
Set rs.ActiveConnection = Conn
'设置游标类型
rs.CursorType = 3
'打开记录集
rs.Open "SELECT * FROM sgx WHERE Col004='" & Trim(UserName) & "'"
'=============身份验证===========================
If rs.EOF Then
Errmsg = "用户不存在"
Else
do while not rs.Eof
If trim(UserPwd) = trim(rs.Fields("Col002")) Then
Session("UserId") = rs.Fields("Col002")
Session("xm") = rs.Fields("Col004")
Response.Redirect"admin/SHOWCHAXUN.ASP"
if trim(UserPwd) <> trim(rs.Fields("Col003")) then
Session("UserId") = rs.Fields("Col003")
Session("xm") = rs.Fields("Col004")
Response.Redirect"admin/SHOWCHAXUN.ASP"
if rs.Eof then
Errmsg = "密码不正确"
end if
rs.MoveNext
loop
end if
end if
%>