Skip Headers

Oracle® Objects for OLE Developer's Guide
10g Release 1 (10.1)

Part Number B10118-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

Deleting Records

See Also
Quick Tour
Employee Form

Users can delete records by navigating to a particular record and clicking on the delete button. Our application prompts the user to verify the deletion, then deletes the record using DbDelete. The program then refreshes the screen with the next record or with the previous record if the user deleted the last record in the dynaset.

The delete click event procedure looks like:

Private Sub cmdDelete_Click()

'prompt user

Response = MsgBox("Do you really want to Delete?", vbYesNo + vbExclamation)

If Response = vbYes Then

EmpDynaset.Delete

'attempt to move to next record

EmpDynaset.MoveNext

If EmpDynaset.EOF Then 'If deleted last record

EmpDynaset.MovePrevious

End If

Call EmpRefresh

End If

End Sub