Zap

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Methods >

Zap

Declaration

procedure Zap;

Description

Remove all records from the table. If a memo file is attached to the table, it is cleared as well. All indexes attached to the work area are also reset to empty.

 

After Zap, only the data structure remains and Eof will return True.

 

image\tip.gif The table must be opened in Exclusive mode in order to perform a Zap operation.

Delphi Example

try

 // Try to open table EXCLUSIVE

 ApTbl.Exclusive := True;  

 ApTbl.Open; 

except

 // If failed, display message and bail out

 on EDatabaseError do 

 begin 

         ShowMessage( 'Could not open ApTbl exclusively!' ); 

         Exit; 

 end; 

 

// Otherwise, remove all records in table

ApTbl.Zap;

See Also

ApolloDelete, Pack