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去了?如果执行的话,他会报错吧。
...全文
89 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
jingxiaoping 2005-03-01
  • 打赏
  • 举报
回复
汗汗,打开方式是不是1,1,如果是的话先改成1,3,之后再看看你上次打开的时候是否关闭连接了。
glite 2005-03-01
  • 打赏
  • 举报
回复
这个问题解决了。

但是,又出现新问题。

在我提交以后


出现下列错误提示:


Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft JET Database Engine 错误 '80004005'

Microsoft Jet 数据库引擎打不开文件'd:\inetpub\wwwroot\carbbs\a.mdb'。 它已经被别的用户以独占方式打开,或没有查看数据的权限。

/carbbs/Connections/cn.asp,行12


问题是,我根本就没有打开那个数据库啊。

mymyal123 2005-03-01
  • 打赏
  • 举报
回复
document.form1

改为

document.all
glite 2005-03-01
  • 打赏
  • 举报
回复
就是本页上的那个hidden元素。在提交后,当前页不是会刷新么?
glite 2005-03-01
  • 打赏
  • 举报
回复
怎么说?难道我没提交么?

应该怎么做?
flybird99 2005-03-01
  • 打赏
  • 举报
回复
晕,这么长的代码,没有实用的,你的CStr(Request("insert")) 是从哪提交的?

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧