dbDelete()

Database function which deletes the current data record.

Synopsis

int dbDelete(dbRecordset recordset);

Parameters

Parameter Meaning
recordset Recordset reference

Return Value

The return value is an error code; 0 indicates the operation has been performed successfully. For other values dbGetError() can be used to obtain detailed error information.

Errors

An error is returned if an invalid record set reference variable is passed, or if it is not permitted to make changes to the data source or record set.

Description

Calling dbDelete() deletes the current data record. The data record pointer then remains on this deleted record, although it is no longer possible to change or read fields. As soon as the record pointer is moved away from the deleted record (with dbMove() or dbAddNew() ), this record can no longer be selected.

The dbDelete() method can only be used with the cursor types adOpenKeyset and adOpenDynamic (provided that the data source supports these types).

One should note that if changes to the current data record are still unfinished when navigation methods are called (dbMove...), these changes are saved by an implicit dbUpdate().

Example

see dbAddNew()

Assignment

ADO, Database functions

Availability

CTRL