xHarbour Reference Documentation > Command Reference |
Delete all records from the current database file
ZAP
The ZAP command deletes all records from a database, leaving an empty database file consisting of the file header only. All associated files like memo file or open index files are emptied as well.
The file operations performed by ZAP require a database file be open in EXCLUSIVE mode. The operation is irreversible, i.e. all data stored in a ZAPped file is lost. It is impossible to RECALL data when the ZAP command is complete.
Use DELETE to mark a record for deletion without losing stored data. Records marked for deletion can be recalled.
See also: | DELETE, PACK, RECALL, USE |
Category: | Database commands |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example shows how to prepare for a ZAP operation in a network PROCEDURE Main USE Customer EXCLUSIVE IF .NOT. NetErr() SET INDEX TO Cust01, Cust02, Cust03 ZAP ELSE ? "ZAP failed" ENDIF CLOSE Customer RETURN
http://www.xHarbour.com