KB #240023: DBF becomes decrypted after xBase PACK command
Type:
Tip
Summary:
This explains why an encrypted DBF might become decrypted after a PACK command and how to avoid it.
Additional Information:
When your program issues a PACK command, XBASE platforms, such as Visual FoxPro or xBase++, use the following procedure internally:
USE original-file
COPY TO temporary-file FOR .NOT. DELETED()
DELETE original-file
RENAME temporary-file TO original-file
In this process, original-file might become decrypted because PACK actually creates a new file. You can avoid this in a couple of different ways:
If you have created a profile using the GUI or CLI, make sure you have selected the “Encrypt new files” option.
Alternatively, turn on N_ENCODENEW before PACKing. E.g.,* turn on "encrypt new files" and save current setting
nCurrent=N_ENCODENEW(1)
PACK
* restore original setting
N_ENCODENEW(nCurrent)
We use cookies and other tracking technologies to improve your browsing experience on our website, to analyze our website traffic, and to understand where our visitors are coming from. By browsing our website, you consent to our use of cookies and other tracking technologies.