Microsoft SDK for Java

delete

The delete method of the Recordset class deletes the current record or a group of records. delete has the following signatures:

delete()
delete(int affectRecords)

Remarks

The delete method marks the current record or a group of records in a Recordset object for deletion. If the Recordset object doesn't allow record deletion, an error occurs. If you are in immediate update mode, deletions occur in the database immediately. Otherwise, the records are marked for deletion from the cache and the actual deletion happens when you call the updateBatch method. (Use the AdoEnums.FilterGroup class to view the deleted records.)

Retrieving field values from the deleted record generates an error. After deleting the current record, the deleted record remains current until you move to a different record. Once you move away from the deleted record, it is no longer accessible.

If you nest deletions in a transaction, you can recover deleted records with the rollbackTrans method. If you are in batch update mode, you can cancel a pending deletion or group of pending deletions with the cancelBatch method.

If the attempt to delete records fails because of a conflict with the underlying data (for example, a record has already been deleted by another user), the provider returns warnings to the Errors object but does not halt program execution. A runtime error occurs only if there are conflicts on all the requested records.

delete()

Deletes the current method.

Syntax

public void delete();

delete(int affectRecords)

Deletes a group of records.

Syntax

public void delete(int affectRecords);

Parameters

affectRecords An AdoEnums.Affect value that determines how many records the delete method will affect. The default value is CURRENT.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.