诚心向各位高人请教一个程序问题,谢谢帮我
我刚学程序,最近下载一个留言本,但在删除留言时出现问题,就是凡是有上传图片的贴子,就删除不了,但没有上传图片的贴子,能成功删除,提示错误如下:MicrosoftVBScr...
我刚学程序,最近下载一个留言本,但在删除留言时出现问题,就是凡是有上传图片的贴子,就删除不了,但没有上传图片的贴子,能成功删除,提示错误如下:
Microsoft VBScript 运行时错误 错误 '800a000d'
类型不匹配: '[string: "2006122915578.gif"]'
/admin/del.asp,行 16
以下是del.asp的源码:
<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<%
dim rs,sql,id,i,str2,tupian,objFSO,fileExt,sql1,rs1,sql2
id=trim(request("selectedid"))
if trim(id)="" then
response.write "<script language=JavaScript>" & chr(13) & "alert('没有选择记录!');" & "history.back()" & "</script>"
response.end
end if
str2=split(id,",")
set rs=server.createobject("adodb.recordset")
for i=0 to ubound(str2)
sql="select * from [xinxi] where id="&cstr(str2(i))
rs.open sql,conn,1,1
'On Error Resume Next
if rs("tupian")=1 then
tupian=rs("tupian")
fileExt=lcase(right(tupian,4))
if fileEXT=".gif" or fileEXT=".jpg" then
call deltu()
end if
end if
rs.close
sql="delete from [xinxi] where id="&cstr(str2(i))
rs.open sql,conn,1,3
sql2="delete from [hf] where xxid='"&cstr(str2(i))&"' "
rs.open sql2,conn,1,3
next
response.write "<script language=JavaScript>" & chr(13) & "alert('删除信息成功!')</script>"
response.write "<meta http-equiv=refresh content=""1;URL=xinxi.asp"">"
response.end
rs.close
set rs=nothing
closedb
sub deltu()
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
if objFSO.fileExists(Server.MapPath("uptupian\"&tupian)) then
objFSO.DeleteFile(Server.MapPath("uptupian\"&tupian))
end if
set objfso=nothing
end sub
%>
我一时不知道是什么原因,请各位一定帮帮我,在此先谢谢了 展开
Microsoft VBScript 运行时错误 错误 '800a000d'
类型不匹配: '[string: "2006122915578.gif"]'
/admin/del.asp,行 16
以下是del.asp的源码:
<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<%
dim rs,sql,id,i,str2,tupian,objFSO,fileExt,sql1,rs1,sql2
id=trim(request("selectedid"))
if trim(id)="" then
response.write "<script language=JavaScript>" & chr(13) & "alert('没有选择记录!');" & "history.back()" & "</script>"
response.end
end if
str2=split(id,",")
set rs=server.createobject("adodb.recordset")
for i=0 to ubound(str2)
sql="select * from [xinxi] where id="&cstr(str2(i))
rs.open sql,conn,1,1
'On Error Resume Next
if rs("tupian")=1 then
tupian=rs("tupian")
fileExt=lcase(right(tupian,4))
if fileEXT=".gif" or fileEXT=".jpg" then
call deltu()
end if
end if
rs.close
sql="delete from [xinxi] where id="&cstr(str2(i))
rs.open sql,conn,1,3
sql2="delete from [hf] where xxid='"&cstr(str2(i))&"' "
rs.open sql2,conn,1,3
next
response.write "<script language=JavaScript>" & chr(13) & "alert('删除信息成功!')</script>"
response.write "<meta http-equiv=refresh content=""1;URL=xinxi.asp"">"
response.end
rs.close
set rs=nothing
closedb
sub deltu()
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
if objFSO.fileExists(Server.MapPath("uptupian\"&tupian)) then
objFSO.DeleteFile(Server.MapPath("uptupian\"&tupian))
end if
set objfso=nothing
end sub
%>
我一时不知道是什么原因,请各位一定帮帮我,在此先谢谢了 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询