Applies To
TQDB, TQDBItem, TQDBView
Declaration
property BeforeOverWrite : TConfirmEvent;
Description
Once a QDB file is opened all actions take place on a copy of its contents. Actions that would commit the copied data back to the original QDB file need to ensure that the file has not been opened in the meantime by some other program or TQDB component.
Such actions (setting the FileName property, freeing the component, calling the SaveAs method, etc.) trigger a BeforeOverWrite event. A handler for this event can present a confirmation request to get the user's permission to go ahead with overwriting the original even though it is in use. Such a handler passes a boolean true/false in the TConfirmEvent's OK parameter.
If no handler is installed, or if OK is set to false, the file is not overwriten. Instead a new QDB file is created with a new name derived from the original by the following algorithm:
"add as many '1.' prefixes to the file name as necessary to produce a unique filename"
e.g., QDBDemo.qdb would become 1.QDBDemo.qdb or, if this latter name were already in use, 1.1.QDBDemo.qdb, etc.