当我打开页面或者刷新页面时,总弹出要提交时出现错误的对话框。部分代码如下:
<%
username=request("name")
num=request("num")
sex=request("sex")
address=request("address")
code=request("code")
phone=request("phone")
company=request("company")
email=request("email")
QQ=request("QQ")
note=request("note")
set rs=server.CreateObject("adodb.recordset")
check="select * from Contacttb where UserName='"&username&"' and UserID='"&num&"'"
rs.open check,conn,1,1
if not rs.eof then
Response.Write check
updatesql="update Contacttb set UserName='"&username&"',Sex='"&sex&"',WhereNow='"&address&"',ZipCode='"&code&"',PhoneNum='"&phone&"',WorkCompany='"&company&"',Email='"&email&"',QQ='"&QQ&"',[Note]='"¬e&"',AlterNum=AlterNum+1 where UserName='"&username&"' and UserID='"&num&"'"
'Response.Write updatesql
set rs1=server.CreateObject("adodb.recordset")
rs1.open updatesql,conn,1,3
Response.Write "<script language='javascript'>alert('更新成功!')</script>"
else
Response.Write "<script language='javascript'>alert('数据库无此用户!请用户重新输入!')</script>"
end if
%>
有什么好的方法解决?先谢谢各位!