The following method may be called as a result of a Cancel button click from the progress dialog, to allow users to cancel a backup operation.
cancelBackup() updating, protected; vars dba : JadeDatabaseAdmin; begin if backupInProgress then backupInProgress := false; backupCancelled := true; if currentFile <> null then updateProgress("Cancel Pending ...", "Current file: " & currentFile.name, 0); // Stop further progress notifications endNotification(currentFile, DbFile.BackupProgressEvent); currentFile := null; endif; // Create a new transient dba to avoid referencing the dba // owned by our backupManager, which may be locked in // transaction state by our asynchronous backup process create dba; dba.abortBackup; else // The backup never started, so assume user just wants to // cancel out of the form unloadForm; endif; epilog delete dba; end;