<!-- #include file="conn.asp "-->
<!--#include file="checkUser.asp"-->
<%
if Request("password1")<>Request("password2") then
	response.write "<script>alert('注意：确认密码与密码不相同!');location.href='useradd.asp';</script>"
	response.End
end if
sql="select * from admin where admin='"&Request("admin")&"'"
'response.write sql
'response.End
set rs=conn.execute (sql)
if not rs.eof then
	response.write "<script>alert('注意：该用户名已经存在!');location.href='useradd.asp';</script>"
	response.End
end if
       Set cmdTemp = Server.CreateObject("ADODB.Command")
       Set InsertCursor = Server.CreateObject("ADODB.Recordset")
       cmdTemp.CommandText = "SELECT * FROM admin WHERE (admin is null)"
       cmdTemp.CommandType = 1
       Set cmdTemp.ActiveConnection = conn
       InsertCursor.Open cmdTemp, , 1, 3
       InsertCursor.addnew 
       InsertCursor("admin") =Request("admin")
       InsertCursor("pwd") =Request("password1")
       InsertCursor.Update
       InsertCursor.close
	   conn.close
       set InsertCursor=nothing
       set conn=nothing
%>
<script language=Javascript>
<!--
alert("添加成功！");
this.document.location="userAdd.asp";
-->
</script>

