Advantage TDataSet Descendant
Encrypts the current record after encryption has been enabled.
procedure AdsEncryptRecord;
AdsEncryptRecord encrypts the current record in the table with the current password set via AdsEnableEncryption. However, any memo or BLOB data associated with the record is not encrypted. To encrypt memo and BLOB data, the entire table must be encrypted via AdsEncryptTable. If the record is already encrypted, it is ignored. Note that you only need to call this API if you want the current record to be encrypted, and you are not going to make changes to the record. Normally, when encryption is enabled, any record that you change will automatically be encrypted.
Note AdsEncryptRecord is only applicable with free tables. The encryption process is done automatically with database tables. Data dictionary administrative access is required to encrypt or decrypt database tables. See Advantage Data Dictionary for more information.
This example encrypts all records in the table and then decrypts all of them.
AdsTable1.Active := TRUE;
AdsTable1.AdsEnableEncryption( 'secret' );
AdsTable1.First;
While AdsTable1.EOF = FALSE Do
Begin
AdsTable1.AdsEncryptRecord;
AdsTable1.Next;
End;
AdsTable1.First;
While AdsTable1.EOF = FALSE Do
Begin
AdsTable1.AdsDecryptRecord;
AdsTable1.Next;
End;