<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<%
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &server.MapPath("data\Student.mdb")
sql="select * from Users"
rs.open sql,conn,1,2
%>
<%
name=request("name")
pass=request("pass")
repass=request("repass")
text=request("text")
sex=request("sex")
sql2="select * from User where Username='name'"
set rs2=server.CreateObject("adodb.recordset")
rs2.open sql2,conn,1,1
if rs2.eof then
response.Write "用户名已存在"
response.end()
end if
if pass=repass then
response.write "两次密码不一致"
response.end()
end if
rs.addnew
rs("UserName")=name
rs("UserPwd")=pass
rs("UserSex")=text
rs("UserHabit")=sex
rs.update
rs.close
set rs=nothing
set conn=nothing
%>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="100%" border="0" align="center">
<tr>
<td>用户名</td>
<td><input name="name" type="text" id="name" /></td>
</tr>
<tr>
<td>密码</td>
<td><input name="pass" type="text" id="pass" /></td>
</tr>
<tr>
<td>确认密码</td>
<td><input name="repass" type="text" id="repass" /></td>
</tr>
<tr>
<td>UserHabit</td>
<td><input name="text" type="text" id="text" /></td>
</tr>
<tr>
<td>UserSex</td>
<td><input name="sex" type="text" id="sex" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="Submit" value="提交" /></td>
</tr>
</table>
</form>
</body>
</html>
自己调试一下吧 ok!