Quote:
Originally posted by fisya
actually i'm not really understand what both of u talking about because i'm new in asp. so, i really need help to elaborate more
|
Try this
objRS.open "Main", objConn, 3, 3 'open recored set for addnew
objRS.AddNew
objRS("Record") = request.form("txtRecordNum") 'set DB field = ?
objRS.Update 'adds recored
objRS.Close 'close record set
'Create a sql varibale
SQL = "Select * FROM DeleteRecord WHERE (Record = '" & what ever record you want to delete & "')
objRS.open SQL, objConn, 3, 3 'open Record set for deletion
if objRS.EOF then ' check to see if record exists first
Error msg record does not exist
else
objRS.delete 'delete current record
end if
objRS.close ' close the recored set
set objRS = nothing ' set the record set object to nothing
objConn.close 'close the connection
Put this were ever yo u need it to fire. This is one way of doing it.