Changes the password of a HFSQL Classic or HFSQL Client/Server data file. The applications that use the former password will no longer be able to access this data file: a password error will be displayed.
Caution: This function is an advanced function. It must be used with great care because it can trigger errors in the client applications.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
// Former password
// Modify the password
// Create a file with password
// Add data
FileA.ItemA = "Test 1"
// Read data
// Change the password
Info("Changing the password...")
Info("Password changed, the first record is read again")
// Read data again
// Manage the errors
<Result> = HChangePassword(<File name> , <New Password>)
- True if the password was modified,
- False otherwise. HError is used to identify the error.
<File name>: Character string (with or without quotes)
Logical name of HFSQL data file (defined in the analysis).
<New Password>: Character string (with quotes)
New password that will be used for the data file.
- If the data file is already password protected, this password must be specified with HPass before using HChangePassword.
- To modify the password of a data file, you must have the rights to perform an automatic modification (hRightsAutoModif constant). These rights can be defined by HModifyFileRights.
- This function starts an automatic modification of the data file. If the data file was encrypted with a different password, it will be entirely re-encrypted with the new password. This operation can take quite a long time.