.................
    rs.open sqlcc1,conn1,1,1
   if rs("ID") NOT IN (25669,25670,25671,25672,25673) then      response.Write "<script>alert('ID不符合!');history.back();</script>"
      response.end
    end if    rs.closeend if
.....................运行后提示下面这个
Microsoft VBScript 编译器错误 错误 '800a03f9' 缺少 'Then' /dh/wuqiduihuan.asp,行 111 if rs("RefItemID") NOT IN (25669,25670,25671,25672,25673) then我想检测ID如果不是那些数字的,提示不符合,这么写提示错误,该怎么改?

解决方案 »

  1.   

    RefItemID in (25669,25670,25671,25672,25673)
    应该放到字符串sqlcc1中的where 后面
    if rs.recordset>0 then 
          response.Write "<script>alert('ID不符合!');history.back();</script>"
          response.end
    end if
      

  2.   

    sql="select * from tb where ID in (25669,25670,25671,25672,25673)"
    rs.open sql,conn1,1,1
    if Not rs("ID").EOF then      response.Write "<script>alert('ID不符合!');history.back();</script>"
          response.end
    end ifrs.close