Delete - method of the AdoRecordset object
Description:
Deletes record in the
AdoRecordset object.
If not specified, then the current record position is selected.
Syntax:
Empty Delete([Long nAffectRecords])
Parameters:
nAffectRecords | [optional] (Long) The value of the ADO AffectEnum type defines which records are to be deleted.
1 (default) - (adAffectCurrent) Current record.
2 - (adAffectGroup) Records that comply with the filtering criteria (the Recordset.Filter property). |
---|
Note:
After deleting a record, the deleted record remains current record until you move to a different record.
Example:
Setting first record as the active record position, in the
PmaAdo object (
"/TestAdoDb"), that is already connected to the database (see the
DbOpen method), by means of the SQL query (
"SELECT * FROM table1"). It is followed by deleting the active record.
JavaScriptVBScriptSelect and copy to clipboard
var oDb = pMe.Pm("/TestAdoDb");
var oRs = oDb.RsOpen("table1", "SELECT * FROM table1", "cursor:dynamic;");
if (oRs)
{
oRs.MoveFirst();
oRs.Delete();
}
Dim oDb
Set oDb = pMe.Pm("/TestAdoDb")
Dim oRs
Set oRs = oDb.RsOpen("table1", "SELECT * FROM table1", "cursor:dynamic;")
If Not oRs Is Nothing Then
oRs.MoveFirst
oRs.Delete
End If