删除代码如下:
set fi=server.CreateObject("adodb.recordset")
fi.open sql,conn,1,3
if Not fi.eof then
Set fso = CreateObject("Scripting.FileSystemObject")
if TRim(fi("Min_Img"))<>"" then
If (fso.FileExists(Server.MapPath("../../Photo/Product/"&fi("Min_Img")))) Then
fso.DeleteFile(Server.MapPath("../../Photo/Product/"&fi("Min_Img")))
end if
end if
if TRim(fi("Max_Img"))<>"" then
If (fso.FileExists(Server.MapPath("../../Photo/Product/"&fi("Max_Img")))) Then
fso.DeleteFile(Server.MapPath("../../Photo/Product/"&fi("Max_Img")))
end if
end if
Set fso=Nothing
dl=conn.execute("delete from MB_Product where id="&ID)
end if