Cancels any changes made to the current or new record in a Recordset object.
RecordsetObject.CancelUpdate()
Newlook Smartclient
Newlook Server
None.
The AddNew method sets the EditMode property of the Recordset to EditAdd. Any changes to the new record are cached locally. The Update method posts the new record to the database and resets the EditMode property to EditNone. The CancelUpdate method deletes the new record and resets the EditMode property to EditNone.
If you are adding a new record when you call the CancelUpdate method, the current record becomes the record that was current before the AddNew method.
If you are in edit mode and want to move off the current record (for example, with Move or Seek), you can use CancelUpdate to cancel any pending changes.
You cannot cancel changes to the current record or a new record after you call the Update method, unless the changes are part of a transaction that you can roll back with the RollbackTrans method.
The following newrecord(), saverecord() and cancelupdate() functions could be attached to command buttons on your form titled "New", "Save" and "Cancel" respectively. These functions allow you to create a new record in the open recordset, Save that record with values of fields on your form and cancel those changes. JSCRIPT// Add a new record to the recordset function newrecord() {
} // Save any changes to the current record function saverecord() {
} // Discard any changes to the current record function cancelupdate() {
}
// Clear the fields on the form function clearrecord() {
}
// Update the current record with the details from the fields on the form function setrecord() {
} // Update the fields on the form with the details from the current record function getrecord() {
|
DBConnect Method | Open Method | Disconnect Method | Close Method | Find Method | Move Method | AddNew Method | BeginTrans Method | CancelUpdate Method | CommitTrans Method | Delete Method | RollbackTrans Method | Seek Method | Update Method | ConnectionString property | DB Connection object
© 2004-2021 looksoftware. All rights reserved.