File : deltmpch.asp. ID : 2510
Skin : Default | Sons-of-obsidian | Sunburst | Highlighter | Frame
<%
dim connect, rs, sql, gtmpch, toconfirm
gtmpch = request.form("gtmpch")
toconfirm = request.form("toconfirm")
set connect = server.createobject("ADODB.Connection")
connect.open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &_
Server.MapPath("\perlphpasp\db\tempdb.mdb"))
if toconfirm = "yes" then
  sql="delete from tempfile where tmpch ='" & gtmpch & "'"
  connect.execute(sql)   	  
  response.write("Delete : ok")
else
  sql = "select * from tempfile where tmpch='" & gtmpch & "'"
  set rs = connect.execute(sql)
  if rs.eof then
    response.write("Not found, so can not delete")
  else
    response.write("<form action=deltmpch.asp method=post>"&gtmpch)
    response.write("<input type=hidden name=gtmpch value='" & gtmpch & "'>")
    response.write("<input type=hidden name=toconfirm value=yes>")
    response.write("<input type=submit value=Confirm>")
    response.write("</form>")
  end if
end if
connect.close
set connect = nothing  
%>