Robycodice:<% dim id,rs,foto id = cint(Request.QueryString("id")) if len(id) > 0 and IsNumeric(id)Then dim upc dim cn Set cn=Server.CreateObject("ADODB.Connection") cn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("vetrinaspeciale.mdb") & ";Persist Security Info=False" cn.open SQL ="SELECT * from vetrina where id = " &id Set Rs = cn.Execute(SQL) if not Rs.EOF then nomefile1=rs("file1") Dim objFSO Set objFSO = Server.CreateObject("Scripting.FileSystemObject") if objfso.fileexists(server.mappath("fotocampernuovi")&"\"&nomefile1) 'Il file viene cancellato solo se esiste objFSO.DeleteFile(server.mappath("fotocampernuovi")&"\"&nomefile1) Set objFSO = Nothing end if 'Cancello il record SQL ="DELETE * FROM vetrina where id =" &id cn.Execute(SQL) end if RS.Close Set RS=nothing cn.close Set Cn=nothing end if %>

Rispondi quotando