Record DeleteRecord Method
Record Fields Collection
Recordset Fields Collection
METHOD: Recordset::Delete
recordsetobject.
Delete
AffectRecords
The
Delete
method is called to mark the current record in a
Recordset
object for deletion. The
Recordset
must support deletions or an error will be generated.
There is one optional parameter.
The optional
AffectRecords
can only be the
adAffectAll
value of the
AffectEnum
constants. The default is also this same value. Note that there are actually four
AffectEnum
constants, but that this parameter currently only recognizes one of these constants.
If you are in immediate update mode, the record will be immediately deleted from the database.
If you are in client-side batch optimistic updating mode, the record will be removed from the
Recordset
, but it will not actually be deleted from the database until you call the
UpdateBatch
method. As long as the cursor is still on the current record that was marked for deletion, you can still access and manipulate that record. Once you move to another record, the deleted record is lost from the
Recordset
. However, you can cancel all types of pending changes, including deletions, by calling the
CancelBatch
method.
One way to keep track of records being marked for a batch deletion is to collect and store the bookmark for each record before calling
Delete
. Another way is to set the
Filter
property to
adFilterPendingRecords
and to search for records with a
Status
property value of
adRecDeleted
.
Attempting to access any of the fields of a record that has been deleted will generate an error.
Code (VBScript):
objRecordset.
Delete
objRecordset.UpdateBatch
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information