我这没问题啊
http://www./
<%
bd=server.MapPath("db.mdb")
set conn=server.CreateObject("adodb.connection")
conn.Open "provider=microsoft.jet.oledb.4.0;data source="&bd
set rs=server.CreateObject("adodb.recordset")
if request("action")="reg" then
set rs=server.createobject("adodb.recordset")
rs.open "select * from [user] where name='"&trim(request("name"))&"'",conn,1,1
if rs.recordcount>0 then
response.write "<script language='javascript'>window.alert('您输入的用户名已存在,请返回重新输入!');history.back(-1);</script>"
response.end()
end if
sql="select * from [user]"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
rs("name")=trim(request.form("name"))
rs("pwd")=trim(request.form("pwd"))
rs("wenti")=trim(request.form("wenti"))
rs("daan")=trim(request.form("daan"))
rs.update
rs.close
set rs=nothing
response.write "<script language=javascript> alert('注册成功,点击确定立即登录!');location.replace('login.asp');</script>"
response.end
end if
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table width="90%" border="1" align="center" cellpadding="10" cellspacing="0">
<tr>
<td>用户注册
<form name="form1" method="post" action="a.asp?action=reg">
<table width="347" border="1" cellpadding="5" cellspacing="0">
<tr>
<td width="142">用户名</td>
<td width="179"><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td>密码</td>
<td><input name="pwd" type="password" id="pwd"></td>
</tr>
<tr>
<td>密码提示问题</td>
<td><input name="wenti" type="text" id="wenti"></td>
</tr>
<tr>
<td>密码提示答案</td>
<td><input name="daan" type="text" id="daan"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="submit" value="注册">
<input type="reset" name="submit" value="重置"> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
我只修改了这几个地方(我标出来了)
[此贴子已经被作者于2007-4-9 15:38:54编辑过]