Function AX_DBFDecrypt() Professional
Decryption of a previously encrypted table.
AX_DBFDecrypt() --> lSuccess
This function returns the logical value .T. if the file is successfully decrypted. It returns .F. if the decryption failed. On a failure of the operation, the methods :getLastError() and :getLastMessage() of the DacSession object can be used to obtain information about the reason of the failure.
The function AX_DBFDecrypt() will decrypt a table using the password set with the AX_SetPass() function (or its command opponent).
After a successful completion of the decryption, the password value will be cleared.
#include "ads.ch"
// Install ADSDBE as default database engine.
PROCEDURE DbeSys
IF !DbeLoad( "ADSDBE" )
Alert( "ADSDBE could not be installed!" )
ENDIF
DbeSetDefault( "ADSDBE" )
RETURN
PROCEDURE Main
// Connect to database server.
LOCAL cConnect := "DBE=ADSDBE;SERVER=\\ALASKA\VOL1"
LOCAL oSession := DacSession():new( cConnect )
IF .NOT. oSession:isConnected()
Alert( "Connection to server could not be established!" )
QUIT
ENDIF
// Open TEST.DBF, set a password for this workarea and
// decrypt the table.
USE Test NEW EXCLUSIVE
AX_SetPass( "Hobbit" )
IF AX_DBFDecrypt()
? "Decryption ok."
ELSE
? "Decryption FAILED!"
ENDIF
// Close databases and disconnect from server.
DbCloseAll()
oSession:disconnect()
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.