Help Center

CAdoRecord.DeleteRecordmethod

Deletes the entity represented by a `Record`.

DatabasesmethodCADORecord.incdocumented

Syntax

FUNCTION DeleteRecord (BYREF wszSource WSTRING = "", BYVAL Async BOOLEAN = FALSE) AS HRESULT

Parameters

NameDescription
wszSourceOptional. A string value that contains a URL identifying the entity (for example, the file or directory) to be deleted. If Source is omitted or specifies an empty string, the entity represented by the current Record is deleted. If the Record is a collection record (RecordType of adCollectionRecord, such as a directory) all children (for example, subdirectories) will also be deleted.
AsyncOptional. A Boolean value that, when True, specifies that the delete operation is asynchronous.

Return value

S_OK (0) or an HRESULT code.

Description

Deletes the entity represented by a Record.

Remarks

Operations on the object represented by this Record may fail after this method completes. After calling DeleteRecord, the Record should be closed because the behavior of the Record may become unpredictable depending upon when the provider updates the Record with the data source.

If this Record was obtained from a Recordset, then the results of this operation will not be reflected immediately in the Recordset. Refresh the Recordset by closing and re-opening it, or by executing the Recordset Requery, or Update and Resync methods.

Note: URLs using the http scheme will automatically invoke the Microsoft OLE DB Provider for Internet Publishing.

Reference

  • Include file CADORecord.inc
  • Defined in AfxNova/CAdoRecord.inc:388
  • Documented in Databases/ADO Classes/CAdoRecord Class.md
  • Topic: CAdoRecord Class