<% '----------------------------------------------------------------- '--Page info '----------------------------------------------------------------- PAGE_NAME = "Product" PAGE_NAME_S = "Products" '----------------------------------------------------------------- '--Page code '----------------------------------------------------------------- ID = Request.QueryString("ID") '----------------------------------------------------------------- '--delete the record from the database '----------------------------------------------------------------- Set DB = New clsDatabase DB.OpenDatabase DATABASE_NAME , DATABASE_USERNAME , DATABASE_PASSWORD numOfRecords = DB.RunQuery("SELECT image FROM tsv_products WHERE id=" & ID) If numOfRecords = -1 Then Call myError("Invalid " & PAGE_NAME & " ID") Else imageName = DB.GetField("image") End If Call DB.RunQuery("DELETE FROM tsv_products WHERE id=" & ID) Set DB = Nothing Set FileSys = New clsFileSystem FileSys.DeleteFile(PRODUCT_IMAGE_PATH & imageName) Set FileSys = Nothing '----------------------------------------------------------------- '-go back where we came from '----------------------------------------------------------------- Response.Redirect "index.asp" %>