I have written a program in VB 6 wherein I want to delete a particular record from MS Access Database Table. I noticed that the record does not get deleted immediately. Only after I close the recordset it disappears. I have a Delete Command Button in a Form that deletes a particular record. After deletion, when I browse the records in the table I noticed that the record has not been deleted. It is only when I close the Form which closes the recordset to that table and when I reopen the recordset I notice that the record gets deleted then. My code is as follows.
Conn.Execute "DELETE FROM <tablename> WHERE FIELD1 = '" & cmdField1.Text & "'"
where Conn is set to a New Connection. So what I did was close the recordset and then reopen it again soon after the above command is executed as follows.
Rs.Open "SELECT * FROM <tablename> ORDER BY FIELD1", Conn, , , cmdTable
Please let me know if I am doing this the right way or is there any other method of solving this issue? But I want to use the Connection.Execute command only.
Please help. Thanks.