Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Advantage CA-Clipper Guide v6.11 - set password http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SET PASSWORD
 Sets the password for encryption/decryption
------------------------------------------------------------------------------

 Syntax

     SET PASSWORD TO <cPassword>

     <cPassword>  specifies a string of data to be used in all
     subsequent encryption/decryption operations. Only the first five
     characters in the string will be used. This value is case-sensitive.
     For example, a string encrypted with the password "BOGUS" would be
     different than if the password "bogus" were used.

     To clear the password, pass an empty string ("") as the parameter.

     Note:  Make sure to trim all trailing spaces from the password
     before using it with the SET PASSWORD command, unless the spaces
     are intended to be part of the password.

 Description

     SET PASSWORD should be made to initiate encryption and decryption in
     the current work area.

     After setting a password with SET PASSWORD, all new records appended
     or updated in the current work area will be encrypted as they are stored.

     To write a previously encrypted record in its decrypted form, use the
     following steps.
        1) Set the password to the correct value.
        2) Read the record.
        3) Clear the password by setting it to an empty string ("").
        4) Update the record and write the data.

     After the password is set, any record read that was previously
     encrypted will be viewed in its unencrypted form. If SET PASSWORD TO
     fails for any reason, a runtime error will be generated.  Without
     the correct password being set, any records that are encrypted will
     be treated as read-only.  If the entire table is encrypted, the entire
     table will be treated as read-only.

     Only one password can be used to encrypt records in a table.  When a
     password is set for the first time on a table, the table header is
     updated with the encryption information.  Subsequent requests to set
     a password on the table will only succeed if the correct password is
     supplied.  To remove encryption information from the table header,
     see AX_DBFDecrypt().

     For additional security, the security code is stored in memory in
     an encrypted form. Therefore, the password  is not easily accessed
     at runtime.

 Example

     // Open TEST.DBF and set SECRET as the encryption password for this
     // work area.  Then, encrypt TEST.DBF.
     USE test VIA "DBFCDXAX" EXCLUSIVE
     SET PASSWORD TO "SECRET"

     ? "Encrypting TEST.DBF: "
     ?? iif( AX_DBFEncrypt(), "OK", "Error" )

     // Open TEST2.DBF and set BOGUS as the encryption password for this
     // work area. Then, encrypt TEST2.DBF.
     USE test2 VIA "DBFNTXAX" NEW EXCLUSIVE
     SET PASSWORD TO "BOGUS"

     ? "Encrypting TEST2.DBF: "
     ?? iif( AX_DBFEncrypt(), "OK", "ERROR" )


See Also: USE AX_SetPassword()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson