帮我看看这个ASP程序错在什么地方吧

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!--#include file="Connections/conn.asp" --><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title></head><%mm = request.QueryString("mm")user=request.Form("user")pass=request.Form("pass")%><%if mm="reg" and user<>"" thenset rs=server.CreateObject("ADODB.recordset")exec="select * from aad where user=✀"+user+"✀"rs.open exec,conn,1,1if rs.eof thenexec="insert into aad(user,pass) values(✀"+user+"✀,✀"+pass+"✀)"conn.execute execconn.closeresponse.write "<script>alert(✀添加成功✀);location=✀index.asp✀;</script>"elseresponse.write "<script>alert(✀添加失败✀);location=✀index.asp✀;</script>"end ifend if%><body><form id="form1" name="form1" method="post" action="index.asp?mm=reg"> <table width="400" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="20" align="center" valign="middle">名称</td> <td height="20"><input name="user" type="text" id="user" /></td> </tr> <tr> <td width="100" height="20" align="center" valign="middle">密码</td> <td height="20"><input name="pass" type="text" id="pass" /></td> </tr> <tr> <td height="20" align="center" valign="middle"> </td> <td height="20"><input type="submit" name="Submit" value="确认添加" /></td> </tr> </table></form></body></html>
2026年09月23日 14:52
有4个网友回答
网友(1):

把“+”改成“&”这个就可以了。

网友(2):

兄弟,LANGUAGE="VBSCRIPT" ,所以 连字符是用&号而不是+号
"select * from aad where user='"+user+"'"
这里改成 "select * from aad where user='"&user&"'"

"insert into aad(user,pass) values('"+user+"','"+pass+"')"
改成 "insert into aad(user,pass) values('"&user&"','"&pass&"')"

网友(3):

错得太离谱了,exec="insert into “aad”这里是什么意思?(user,pass) values('"+user+"','"+pass+"')"
还有就是你的user和pass是数字类型字段么?如果是字符串就不应该加单引号啊。
改了之后你试试
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>





无标题文档

<%
mm = request.QueryString("mm")
user=request.Form("user")
pass=request.Form("pass")
%>
<%
if mm="reg" and user<>"" then
set rs=server.CreateObject("ADODB.recordset")
exec="select * from aad where user="&user
rs.open exec,conn,1,1
if rs.eof then
exec="insert into (user,pass) values("&user&","&pass&")"
conn.execute exec
conn.close
response.write ""
else
response.write ""
end if
end if
%>















名称
密码




如果还报错你就把错误说明发一下,我看看是什么问题导致的

网友(4):

哥们,错误代码先贴出来先