The first example uses CancelUpdate to abort an AddNew. The second example uses CancelUpdate to abort an Edit.
See How to Build the DAO Method Samples.
If you have installed the DAO SDK, see InstallDirectory\DAOSDK\SAMPLES\CancelUpdate1.cpp and CancelUpdate2.cpp.