sql11="select * from cp"
其实个人觉得楼主的代码还是直接用sql方便
sql11="select * from cp where cp_name='"&Request("cpname")&"'"
sql11=sql11&" and cp_bh="&Request("cpbh")
sql11=sql11&" and cp_scqy='"&Request("cpcd")&"'"
rs11.open sql11,conn,1,3
sub scripterr
response.write"<script>alert('操作出错,下面是产生错误的可能原因:\n\n"&errstyle&"');history.go(-1);</script>"
response.end
end sub
if not rs11.eof then
errstyle="·输入内容相同,数据库中已存在"
scripterr
end if
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from zx where id="& session("id")
rs.open sql,conn,1,3
rs.addnew
rs("SMT_cpname")=cpname
rs("SMT_cpbh")=cpbh
rs("SMT_cpcd")=cpcd
rs("id")=session("id")
rs.update
rs.close
set rs=nothing
这样不比验证一大堆要省事?