S
shiner
Unregistered / Unconfirmed
GUEST, unregistred user!
我从网上下载了一个"下载管理"的ASP,上传到我的ASP空间,但其中CONN.ASP中有一行这样的
on error resume next 可空间服务器不允许,所以我把它删掉了,但问题就来了,在另一个
savefile.asp文件执行时提示:
Microsoft VBScript 运行时错误 错误 '800a01a8'
缺少对象: 'noting'
/223/savefile.asp, 行52
请问该怎么改?下面是两个文件的源码:
conn.asp
<%
dim conn
dim connstr
connstr="DBQ="+server.mappath("download.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>
savefile.asp
<%
if request.cookies("adminok")="" then
response.redirect "login.asp"
end if
%>
<!--#include file="conn.asp"-->
<!--#include file="inc/char.inc"-->
<%
dim filename
dim showname
dim typename
dim note
dim sql
dim rs
dim cansave
dim founderr
dim errmsg
dim hot
dim face
founerr=false
if trim(request.form("txtfilename"))="" then
founderr=true
errmsg="<li>下载的程序文件名不能为空</li>"
end if
if trim(request.form("txtshowname"))="" then
founderr=true
errmsg=errmsg+"<li>显示名称不能为空</li>"
end if
if founderr=false then
filename=htmlencode2(request.form("txtfilename"))
showname=htmlencode2(request.form("txtshowname"))
typename=htmlencode2(request.form("typename"))
note=htmlencode2(request.form("txtnote"))
hot=htmlencode2(request.form("hot"))
face=htmlencode2(request.form("face"))
set rs=server.createobject("adodb.recordset")
sql="select * from do
wnload where (id is null)"
rs.open sql,conn,1,3
rs.addnew
rs("filename")=filename
rs("showname")=showname
rs("typename")=typename
rs("note")=note
rs("face")=face
rs("hot")=hot
rs("dateandtime")=date()
rs.update
rs.close
set rs=noting
conn.close
set conn=nothing
%>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="download.css">
</head>
<body>
<div align="center"><center>
<table border="1" cellspacing="0" width="50%" bordercolorlight="#000000"
bordercolordark="#FFFFFF" cellpadding="0">
<tr>
<td width="100%" bgcolor="#D5EFFF" height="20"><p align="center"><font color="#000000"><b>添加程序成功</b></font></td>
</tr>
<tr>
<td width="100%"><p align="left"><br>
其文件名为:<%response.write filename%><br>
显示名称为:<%response.write chinesename%></p>
<p align="center">是否继续添加?<br>
<br>
<a href="add.asp">是</a>
<a href="edit.asp">否</a><br>
<br>
</td>
</tr>
</table>
</center></div><%
else
response.write "由于以下的原因不能保存数据:"
response.write errmsg
end if
%>
</body>
</html>
on error resume next 可空间服务器不允许,所以我把它删掉了,但问题就来了,在另一个
savefile.asp文件执行时提示:
Microsoft VBScript 运行时错误 错误 '800a01a8'
缺少对象: 'noting'
/223/savefile.asp, 行52
请问该怎么改?下面是两个文件的源码:
conn.asp
<%
dim conn
dim connstr
connstr="DBQ="+server.mappath("download.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>
savefile.asp
<%
if request.cookies("adminok")="" then
response.redirect "login.asp"
end if
%>
<!--#include file="conn.asp"-->
<!--#include file="inc/char.inc"-->
<%
dim filename
dim showname
dim typename
dim note
dim sql
dim rs
dim cansave
dim founderr
dim errmsg
dim hot
dim face
founerr=false
if trim(request.form("txtfilename"))="" then
founderr=true
errmsg="<li>下载的程序文件名不能为空</li>"
end if
if trim(request.form("txtshowname"))="" then
founderr=true
errmsg=errmsg+"<li>显示名称不能为空</li>"
end if
if founderr=false then
filename=htmlencode2(request.form("txtfilename"))
showname=htmlencode2(request.form("txtshowname"))
typename=htmlencode2(request.form("typename"))
note=htmlencode2(request.form("txtnote"))
hot=htmlencode2(request.form("hot"))
face=htmlencode2(request.form("face"))
set rs=server.createobject("adodb.recordset")
sql="select * from do
wnload where (id is null)"
rs.open sql,conn,1,3
rs.addnew
rs("filename")=filename
rs("showname")=showname
rs("typename")=typename
rs("note")=note
rs("face")=face
rs("hot")=hot
rs("dateandtime")=date()
rs.update
rs.close
set rs=noting
conn.close
set conn=nothing
%>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="download.css">
</head>
<body>
<div align="center"><center>
<table border="1" cellspacing="0" width="50%" bordercolorlight="#000000"
bordercolordark="#FFFFFF" cellpadding="0">
<tr>
<td width="100%" bgcolor="#D5EFFF" height="20"><p align="center"><font color="#000000"><b>添加程序成功</b></font></td>
</tr>
<tr>
<td width="100%"><p align="left"><br>
其文件名为:<%response.write filename%><br>
显示名称为:<%response.write chinesename%></p>
<p align="center">是否继续添加?<br>
<br>
<a href="add.asp">是</a>
<a href="edit.asp">否</a><br>
<br>
</td>
</tr>
</table>
</center></div><%
else
response.write "由于以下的原因不能保存数据:"
response.write errmsg
end if
%>
</body>
</html>