% if session("editor") = "" then response.Redirect("index.asp") end if borra = Trim(Request.QueryString("borra")) if borra = "si" then id = Trim(Request.QueryString("id")) Set DB = Server.CreateObject("ADODB.Connection") set rs = server.CreateObject("ADODB.recordset") DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=C:\Inetpub\vhosts\sportstime.com.mx\httpdocs\db\_galeria.mdb") SQL = "SELECT * FROM fotos where id = " & id rs.open SQL, DB, 3, 3 nombre = rs.fields("nombre") dim fs, ruta ruta = "C:\Inetpub\vhosts\sportstime.com.mx\httpdocs\web\imagenes\fotogal\" & nombre Set fs=Server.CreateObject("Scripting.FileSystemObject") if fs.FileExists(ruta) then fs.DeleteFile(ruta) end if set fs=nothing rs.close SQL = "DELETE FROM fotos WHERE id = " & id set rs = DB.execute(SQL) DB.close Msg = "Imagen eliminada." end if %>
|
<< Regresar |