Promotic
WikipediaLinkedInYoutubeTwitterFacebook

CancelUpdate - method of object AdoRecordset

Description:
It is used for ending the edit mode and cancelling all modifications to the current record. The edit mode was started by calling the AddNew method (in this case the new record is cancelled) or by writing the values into the current record (record edit).
Syntax:
CancelUpdate
Calling:
oRs.CancelUpdate
See also:
Example:
Adding a new record into the table ("table1") and modifying the contents of the new record, by using the stored AdoRecordset object ("table1"), over the PmAdo object ("/TestAdoDb"), that is already connected to the database (see DbOpen), by the SQL query ("SELECT * FROM table1"). At the end, the adding of a new record is not confirmed by the Update method, but cancelled by the CancelUpdate method.
Dim oDb, oRs
Set oDb = pMe.Pm("/TestAdoDb")
Set oRs = oDb.RsOpen("table1", "SELECT * FROM table1", "cursor:static;lock:optimistic;")
  oRs.AddNew
  oRs.Fields("name") = "pi"
  oRs.Fields("value") = 3.14
  oRs.CancelUpdate
End If
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice