<!--#include file="inc/conn.asp"-->
<meta http-equiv="pragma" content="no-cache"> <%
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from data where bianhao='"&request.Form("bianhao")&"'"
rs1.open sql1,conn,1,1
do while not rs1.eof and rs1.bof
if not rs1.eof and not rs1.bof then
response.write("<SCRIPT language=JavaScript>alert('编号已存在,请重新输入');history.back();</SCRIPT>")
response.end
end if
rs1.movenext
loop
set rs1=nothing
set rs=server.CreateObject("adodb.recordset")
sql="select * from data"
rs.open sql,conn,1,3
rs.addnew
rs("bianhao")=request.Form("bianhao")
rs.update
rs.close
set rs=nothing
response.Redirect("list.asp")
%>
为什么每次都会出现“编号已存在,请重新输入”这句话??