asp脚本为什么不执行?(菜鸟)
glite 2005-03-01 02:05:58 <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#INCLUDE FILE="system/systemdefine.inc"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>注册信息</title>
</head>
<body>
<%
Dim adoCmd
If (CStr(Request("insert")) = "yes") Then
Set adoCmd = Server.CreateObject("ADODB.Command")
adoCmd.ActiveConnection = Application("adoconn")
adoCmd.CommandText = "insert into "
adoCmd.Execute
adoCmd.ActiveConnection.Close
session("UserName") = CStr(Request("name"))
Response.Redirect("listmain.asp")
End If
%>
<script language=javascript>
//判断输入是否为空
function check(){
if (document.form1.name.value=='')
{alert("请输入用户名");
document.form1.name.focus();
return false;
}
if (document.form1.psw.value=='')
{alert("请输入密码");
document.form1.psw.focus();
return false;
}
if (document.form1.pswc.value!=document.form1.psw.value)
{alert("密码确认不正确!");
document.form1.pswc.focus();
return false;
}
if (document.form1.quesion.value=='')
{alert("请输入密码问题");
document.form1.quesion.focus();
return false;
}
if (document.form1.answer.value=='')
{alert("请输入密码问题答案");
document.form1.answer.focus();
return false;
}
document.form1.submit.disabled=true;
}
</script>
<form name=form1 action="register.asp" method=post onSubmit="return check()">
<table border="0" align=center cellpadding=1 cellspacing=1 >
<input name="insert" type="hidden" value="yes">
<TBODY>
<TR align=middle class="TableHead">
<Th colSpan=2 height=24>新用户注册</TD> </TR>
<TR >
<TD width=40% ><strong>用户名:<BR>
注册用户名长度限制为3-12字节</strong></TD>
<TD width=60% > <strong>
<INPUT maxLength="12" size=30 name=name>
<font color=red>* </font>帐号即昵称 标"<font color=red>*</font>"为必填项</strong></TD>
</TR>
<TR>
<TD width=40% ><strong>性别:<BR>
请选择您的性别</font></strong></TD>
<TD width=60% > <strong>
<INPUT type=radio CHECKED value=1 name=sex>
男
<INPUT type=radio value=0 name=sex>
女</font></strong></TD>
</TR>
<TR>
<TD width=40% ><strong>密码(至少6位):<BR>
请输入密码,区分大小写。<BR>
请不要使用任何类似 '*'、' ' 或 HTML 字符 </strong></TD>
<TD width=60% > <strong>
<INPUT type=password maxLength=16 size=30 name=psw>
<font color=red>*</font> </strong></TD>
</TR>
<TR>
<TD width=40% ><strong>密码(至少6位):<BR>
请再输一遍确认</strong></TD>
<TD > <strong>
<INPUT type=password maxLength=16 size=30 name=pswc>
<font color=red>*</font> </strong></TD>
</TR>
<TR>
<TD width=40% ><strong>密码问题:<BR>
忘记密码的提示问题</strong></TD>
<TD > <strong>
<INPUT type=text size=30 name=quesion>
<font color=red>*</font> </strong></TD>
</TR>
<TR>
<TD width=40% ><strong>问题答案:<BR>
忘记密码的提示问题答案,用于取回论坛密码</strong></TD>
<TD > <strong>
<INPUT type=text size=30 name=answer>
<font color=red>*</font> </strong></TD>
</TR>
<TR>
<TD width=40% ><strong>Email地址:<BR>
请输入有效的邮件地址,这将使您能用到论坛中的所有功能</font></strong></TD>
<TD width=60% > <strong>
<INPUT maxLength=50 size=30 name=e_mail>
<input type=button value='检测帐号' name=Button onclick=gopreview()>
</strong></TD>
</TR>
</tbody>
</table>
</td></tr></tbody></table>
<div align="center">
<input type="submit" name="Submit" value="注册">
<input name="Submit2" type="reset" value="清除">
</div>
</form>
</body>
</html>
为什么在提交表单后,adoCmd.Execute好象没有执行,而是直接跳到listmain.asp去了?如果执行的话,他会报错吧。