对象关闭不允许操作?
大家好:请教一小段代码,批量删除产品与产品图片,总是提示“对象关闭时不允许操作”:<!--#include file="conn.asp"-->
<%
Function DeleteFile(FileName)
FileName=server.MapPath("../UploadFile/"&FileName) '必须转换成绝对路径的
dim Fso
Set Fso = CreateObject("scripting.filesystemobject")
if Fso.FileExists(Filename) then '判断文件是否存在
Fso.DeleteFile filename
end if
Set Fso = nothing
End Function
arrdel=Request("id")
sql="delete from p_info where p_id in ("&arrdel&")"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
do while not rs.eof
DeleteFile(rs("p_pic"))
rs.movenext
loop
conn.Execute sql
Response.write "<script language = 'javascript'>window.document.location.href='admin_pro.asp';</script>"
response.end
%>