槽边往事.mobi下载:Microsoft VBScript 运行时错误 (0x800A01A8) 急~

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 12:23:45
提示:
Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: 'conn'
/UpFile.asp, 第 9 行
各位大哥帮帮小弟,小弟很菜的,能详细的解答一下吗,谢谢!
<%
if session("admin")="" then
conn.close
set conn = nothing
response.Redirect "login.asp"
response.End
else
if request.cookies("timesboard")("admin")="" then
conn.close
set conn = nothing
response.Redirect "login.asp"
response.End
end if
end if

formName=request("formName")
EditName=request("EditName")
%>
<html>
<head>
<title>系统上传模块</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
<!--
function mysub()
{
var strFileName=form1.file1.value;
if (strFileName=="")
{
alert("请选择要上传的文件");
return false;
}
esave.style.visibility="visible";
}
-->
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="upload.asp" enctype="multipart/form-data" onSubmit="return mysub()">
<div id="esave" style="position:absolute; top:18px; left:40px; z-index:10; visibility:hidden">
<TABLE WIDTH=340 BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><td width=20%></td>
<TD bgcolor=#104A7B width="60%">
<TABLE WIDTH=100% height=120 BORDER=0 CELLSPACING=1 CELLPADDING=0>
<TR>
<td bgcolor=#eeeeee align=center><font color=red>正在上传文件,请稍候...</font></td>
</tr>
</table>
</td><td width=20%></td>
</tr>
</table>
</div>
<table width="400" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#6699ff">
<tr>
<td height="22" align="left" valign="middle" width="400"> <strong>系统上传模块</strong>
<input type="hidden" name="EditName" value="<%=EditName%>">
<input type="hidden" name="FormName" value="<%=formName%>">
<input type="hidden" name="act" value="uploadfile">
</td>
</tr>
<tr align="center" valign="middle">
<td align="left" id="upid" height="80" width="400" bgcolor="#FFFFFF"> 选择文件:
<input type="file" name="file1" style="width:300'" class="tx1" value="">
</td>
</tr>
<tr align="center" valign="middle">
<td height="24" width="400">
<input type="submit" name="Submit" value="· 开始上传 ·" class="button">
</td>
</tr>
</table>
</form>
</body>
</html>
试了<!--#include file="conn.asp" -->
但打开页面却被直接转到后面登陆页面,晕
还有其它简单点的办法吗?谢谢

如果你发上来的是全部的代码,那你就是缺少了连接文件。
你的文件一开始就要判断这个用户的真实身份,如果是假就要关闭数据库。
但是你没有调用打开数据库连接的文件,也就是说你在关闭数据库之前没有打开数据库。

你在最开始加上那个最常用的include就可以了。
不行,你再来问。

MicrosoftVBScript 运行时错误(0x800A01A8)-->缺少对象

很明显缺少对象。conn没有定义。

可以用include把包含conn的文件括进来

一般在页面最上面加
<!--#include file="conn.asp" -->

是不是应该先从登陆页面打开转到当前页面啊 如果你直接打开此页面肯定
session(“admin”)是空的 那就执行判断语句里的跳转语句直接到了登陆页面了 不是吗