ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • When to use HPass?
  • Defining a password on a data file
  • Deleting the password defined on a data file
  • Managing passwords (OLE DB and Native Accesses)
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Defines the password used to create or open a data file. The password is stored and it will be used when opening or creating the data file if no password is specified.
Remarks:
  • Caution: A password is required to encrypt data.. The data encryption must be configured during the file description in the data model editor ("Details" tab).
  • This password can also be specified in the functions for creating the data file (HCreation, HCreationIfNotFound) and for opening the data file (HOpen).
  • Encrypted files in an HFSQL connection: &nbspCaution: The order of use of functions for connecting to an HFSQL Client/Server database is important.. For more details, see Optimizing the connection times to the HFSQL Client/Server databases.
Example
// Ouverture d'un fichier de données avec mot de passe et contrôle d'erreur
HPass(CLIENT, "MotDePasse")
IF HCreationIfNotFound(CLIENT) = False THEN
	Error("Erreur HFSQL: " + HErrorInfo())
	RETURN
END
// HErreurMotDePasse permet de savoir si l'erreur rencontrée est une erreur de mot de passe
IF HCreationIfNotFound() = False THEN
	// Détail de l'erreur
	IF HErrorPassword() = True THEN
		Error("Mot de passe invalide")
		// Code pour réessayer
	END
END
Syntax
<Result> = HPass(<Data file> [, <Password>])
<Result>: Boolean
  • True if the password is saved,
  • False if an error occurred (insufficient memory for example). HError and HErrorInfo return more details about the problem.
<Data file>: Character string
Name of data file that uses a password.
If this parameter corresponds to "*", the password will be used for all the data files described in the analysis.
This parameter can also correspond to the name of a group of files (or custom-folder) defined in the analysis (not available in Android and Android widget). In this case, the password will be used for all the files of the group.
If the data file is declared with HDeclareExternal, <File name> corresponds to the name of the data file alias.
<Password>: Optional character string
Password associated with the data file.
If this parameter is not specified or if it corresponds to an empty string (""), no password is defined for the data file. The password size is not limited.
HFSQL ClassicHFSQL Client/Server The password of HFSQL files is not case-sensitive.
Remarks

When to use HPass?

HPass must be called:
  • before explicit opening or creation functions: HOpen, HCreation, HCreationIfNotFound.
  • before the HFSQL functions that access the date files and that automatically open the data files if not already done (read, search, add, ...).
Remarks:
  • If a password is specified in the explicit opening or creation functions (HOpen, HCreation, HCreationIfNotFound), the password specified in HPass is ignored.
  • The password of HFSQL files is not sensitive to the case.
  • To change a password on an existing data file or add a password to a data file created without a password, you must use HChangePassword.

Defining a password on a data file

A data file will be protected by password if:
  • HPass was used before the function for creating the data file (HCreation and HCreationIfNotFound),
  • or the password has been specified directly in the data file creation function.
Remark: A data file can be password-protected without being encrypted, and vice versa.. The password is independent of data encryption. The data encryption must be configured during the file description in the data model editor ("Details" tab).

Deleting the password defined on a data file

To delete a password on a data file, an automatic data file modification must be performed.
To do so, perform a modification in the analysis (modify the size of an item for example). In this case, an automatic data file modification will be proposed when the analysis is generated. You will be able to modify or delete the password associated with one or more data files.
If your data files are already deployed, specify that an automatic data file modification is required when creating the setup program. The password will be deleted or modified.
Attention: if you remove the password from your data files, don't forget to adapt your code.
OLE DBNative Connectors (Native Accesses)

Managing passwords (OLE DB and Native Accesses)

The password must be specified in the parameters of the connection.
Business / UI classification: Business Logic
Component: wd300hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Criando um HFSQL com senha e acessando o conteudo
// Create all the data files described in the analysis
// with the "PSW" password
HCreationIfNotFound("*", "Password")
// Open a file with password and error check
IF HCreationIfNotFound(CUSTOMER) = False THEN
Error("HFSQL error: " + HErrorInfo())
RETURN
END
// HErrorPassword is used to find out whether the error that occurred is a password error
IF HCreationIfNotFound() = False THEN
// Details of the error
IF HErrorPassword() = True THEN
Error("Invalid password")
// Code to retry
END
END
BOLLER
06 Jul. 2017

Last update: 09/24/2024

Send a report | Local help