xoae1_id = replace(Request.Form("MM_recordId"),"'","''")
sConnString = MM_conn_STRING
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open(sConnString)
sSQL = "(SELECT username AS xusername, patient_id_oae1 AS xpatient_id_oae1, specify1 AS xspecify1, oae1_grade AS xoae1_grade FROM tbl_oae_1 WHERE oae1_id = '" & xoae1_id & "'"
response.write sSQL
Set rs=objConn.execute(sSQL)
if not rs.eof then
sSQL1 = "INSERT INTO tbl_oae_1_log (username, patient_id_oae1, specify1, oae1_grade) VALUES (CONCAT('" & replace(rs("xusername"),"'","''") & "',' DELETED'),CONCAT('" & replace(rs("xpatient_id_oae1"),"'","''") & "',' DELETED'),CONCAT('" & replace(rs("xspecify1"),"'","''") & "',' DELETED'),CONCAT('" & replace(rs("xoae1_grade"),"'","''") & "',' DELETED'))"
response.write sSQL1
objConn.execute(sSQL1)
sSQL2 = "DELETE FROM tbl_oae_1 WHERE oae1_id = '" & xoae1_id & "'"
response.write sSQL2
objConn.execute(sSQL2)
end if
If err.number=0 Then
response.write "the data was deleted successfully."
End If
objConn.Close
Set objConn = nothing
|