Microsoft VBScript 运行时错误 (0x800A01A8)缺少对象: 'conn' 20
<%@LANGUAGE="VBSCRIPT"%><!--includefile="conn.asp"--><%dimactionaction=request.Form("...
<%@LANGUAGE="VBSCRIPT"%>
<!--include file="conn.asp"-->
<%
dim action
action=request.Form("action")
if action="save" then
call save()
%>
<%
sub save()
dim name,password
name=request.Form("nm")
password=request.Form("pw")
if name="" then
response.Write("<script language='javescript'>")
response.Write("alert('用户名不能为空,请返回!')")
response.Write("history.go(-1)")
response.Write("</script>")
response.end
end if
sql="insert into [admin] (name,pw) values ('"&nm&"','"&pw&"')"
conn.execute(sql)
conn.close
set conn=nothing
end sub
%>
<p align="center">添加成功!<a href="admin.asp"</a>
<%else%> <b> <font size="5"添加管理员</font></b> </p>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<form id="form1" name="form1" method="post" action="admin.asp?action=save">
<label>用户名
<input name="nm" type="text" id="nm" />
</label>
<label>密码
<input type="text" name="pw" />
</label>
<input type="submit" name="Submit" value="添加" />
<input type="reset" name="Submit" value="重置" />
</form>
</table>
<%end if%> 展开
<!--include file="conn.asp"-->
<%
dim action
action=request.Form("action")
if action="save" then
call save()
%>
<%
sub save()
dim name,password
name=request.Form("nm")
password=request.Form("pw")
if name="" then
response.Write("<script language='javescript'>")
response.Write("alert('用户名不能为空,请返回!')")
response.Write("history.go(-1)")
response.Write("</script>")
response.end
end if
sql="insert into [admin] (name,pw) values ('"&nm&"','"&pw&"')"
conn.execute(sql)
conn.close
set conn=nothing
end sub
%>
<p align="center">添加成功!<a href="admin.asp"</a>
<%else%> <b> <font size="5"添加管理员</font></b> </p>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<form id="form1" name="form1" method="post" action="admin.asp?action=save">
<label>用户名
<input name="nm" type="text" id="nm" />
</label>
<label>密码
<input type="text" name="pw" />
</label>
<input type="submit" name="Submit" value="添加" />
<input type="reset" name="Submit" value="重置" />
</form>
</table>
<%end if%> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询