是这样的 大家看看if (Request("action") = "Mod") and (VisitId <> "") then sql="select top 1 iid from tblUser where sName='" &vname&"' and iid <> " & VisitId rs.open sql ,conn,1,1 if not rs.eof then Response.write "<script>alert('用户名:"&vName&"已经存在,请换个用户名再尝试!');history.back();</script>" rs.close response.end end if rs.close sql = "select * from tblUser where iId = " & VisitId rs.open sql,conn,1,3
{
document.form1.action = "VisitAdd.asp?action=Add";
}
else
{
document.form1.action = "VisitAdd.asp?action=Mod";
}
return true;
sql="select top 1 iid from tblUser where sName='" &vname&"' and iid <> " & VisitId
rs.open sql ,conn,1,1
if not rs.eof then
Response.write "<script>alert('用户名:"&vName&"已经存在,请换个用户名再尝试!');history.back();</script>"
rs.close
response.end
end if
rs.close
sql = "select * from tblUser where iId = " & VisitId
rs.open sql,conn,1,3