xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

ZAP

Delete all records from the current database file

Syntax

ZAP

Description

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.

Info

See also:DELETE, PACK, RECALL, USE
Category: Database commands
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe