DbfDecrypt

<< Click to Display Table of Contents >>

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

DbfDecrypt

Declaration

function DbfDecrypt: WordBool;

Description

Decrypts a table that has been encrypted at the file level with DbfEncrypt or decrypt all records that have been encrypted at the record level by setting SetPassword.

 

The password used in decrypting the table must be set via SetPassword and of course must be the same one used to encrypt the data in the first place.

 

The progress of the function may be visually monitored if a gauge hook has been set with SetGaugeHook.

 

The file should be opened for exclusive use before encrypting or decrypting.

Return Value

True if the function is successful and False if not.

 

If the operation is successful, the table header block is rewritten as a standard xBase compatible header block. A table encrypted at the file level may not be read by other xBase compatible programs.

Delphi Example

// Decrypt an encrypted table

with ApTbl do

begin

SetPassword( 'SHAZAM' ); 

if not DbfDecrypt then

 ShowMessage( 'Database decrypting failed' ) 

else  

 ShowMessage( 'Database decrypting succeeded' ); 

end;

C++Builder Example

// Decrypt an encrypted table

ApTbl->SetPassword( "SHAZAM" );

if (!DbfDecrypt())

 ShowMessage( "Database decrypting failed" ); 

else

 ShowMessage( "Database decrypting succeeded" ); 

See Also

DbfEncrypt, SetGaugeHook, SetPassword