<%
set rs=server.createobject("adodb.recordset")
sql="select * from store"
rs.open sql,conn,1,1
do while not rs.eof
rs("number")<rs("min")
response.Write "<script language=javascript>alert('对不起,库存已少于最低存货量,请及时补充!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=min.asp"">"
response.end
loop
rs.movenext
rs.close
%>
请问,这段代码到底哪里出错了,为什么NUMBER里的数据比MIN里的大,却仍弹出对话框.(注:NUMBER及MIN里的值并非只有一条,都是自动增加的)
參考答案:<%
set rs=server.createobject("adodb.recordset")
sql="select * from store"
rs.open sql,conn,1,1
do while not rs.eof
if rs("number")<rs("min") then
response.Write "<script language=javascript>alert('对不起,库存已少于最低存货量,请及时补充!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=min.asp"">"
response.end
end if
rs.movenext
loop
rs.close
%>