PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

This content has been translated automatically. Click here to view the French version.
  • Operating mode of custom errors
  • Using a class method to customize the errors
  • Customizing the default error windows
  • Customizing the default error pages
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Customizes the management of HFSQL errors.
WINDEV, WEBDEV and WINDEV Mobile propose an automatic management of errors. The automatic management of errors can be disabled or enabled for one or more data files, for one or more types of errors. To do so, use HOnError and specify an empty string for the name of window, page or procedure. For more details, see Assisted management of HFSQL errors.

HFSQL Client/ServerStored procedures The automatic management of errors is not available for the stored procedures.
Versions 24 and later
Stored procedures HOnError can be used to manage the error in a stored procedure.
New in version 24
Stored procedures HOnError can be used to manage the error in a stored procedure.
Stored procedures HOnError can be used to manage the error in a stored procedure.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
WEBDEV - Server codeAjaxHFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses)
// Personnalisation des erreurs de blocages
// La procédure SurErreurBlocage est appelée
// en cas d'erreur de blocage pour tous les fichiers de données
HOnError("*", hErrLock, "SurErreurBlocage")
WEBDEV - Server codeHFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses)
// Ré-activation générale de la gestion automatique
// de toutes les erreurs sur tous les fichiers de données
HOnError("*", hErrAll)
WEBDEV - Server codeAjaxHFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses)
// Ré-activation générale de la gestion automatique
// des erreurs de blocage sur le fichier de données Client
HOnError("Client", hErrLock)
Syntax
<Result> = HOnError(<Data file> , <Type of error> [, <Procedure/window/page>])
<Result>: Boolean
  • True if the operation was successfully performed,
  • False otherwise. HError returns more details about the problem.
<Data file>: Character string
Name of the data file used. If this parameter is equal to "*" the customization will be applied to all data files found in the analysis or defined through programming.
<Type of error>: Constant or combination of constants
Type of error to configure.
hErrDatabaseAccessSetting of access errors to an HFSQL Client/Server database (access prohibition by the HNoDatabaseAccess function).
hErrLockConfigure lock errors.
hErrDuplicatesConfigure duplicate errors.
hErrIntegrityConfigure integrity errors.
hErrModifyConfigure a modification conflict.
hErrPasswordConfigure password errors (wrong password).
hErrConnectionLossConfigure the errors caused by a loss of connection with the HFSQL server.
hErrIndexConfigures indexing errors (reindexing in progress during the file access).
hErrNeedValueConfigure errors caused by a required value that has not been specified (OLE DB and some Native Connectors).
hErrAllConfigure all previous errors (except hErrIndex).
<Procedure/window/page>: Optional character string
Corresponds to:
  • WEBDEV - Server code Name of page or procedure to call when a <Type of error> error occurs.
  • Name of object method if HOnError is called in a method of this object.
  • Parameter not specified. If "Enable the automatic HFSQL help" is checked in the project, the default window or page for automatic management of errors is used for the specified type of error and for the specified data file.
  • Empty string. In this case, the automatic management of errors will be disabled.
    Remark: To disable the automatic management of errors, you also have the ability to uncheck "Enable the automatic HFSQL help" in the project.
Remark: In some cases (loss of connection errors for example), the procedure/window/page will be run during the next call to the WLanguage function following the event that triggered the error.
WEBDEV - Server code Only some of the windows/pages for the automatic management of errors are available. The automatic management of errors is disabled for these errors.

Special case: using a window, a page or a procedure found in a component: The following syntax must be used:
Procedure:
HSurErreur(<Fichier de données>, <Type>, ...
"<Composant>.<Nom de la Collection de procédures>.<Nom de la procédure>")

Window:
HSurErreur(<Fichier de données>, <Type>, "<Composant>.<Nom de la fenêtre>")

Page:
HSurErreur(<Fichier de données>, <Type>, "<Composant>.<Nom de la page>")
HFSQL Client/Server If a loss of connection occurs, to ask for reconnection, this procedure must call HReconnect.
Remarks

Operating mode of custom errors

The procedure, window or page used to customize the error must return one of the following constants:
opRetryThe function that triggered the error is re-run.
opCancelThe function that triggered the error returns an error as if the assisted management was disabled.
Remark: For the errors of loss of connection, the error is fatal.
opEndProcessThe function that triggered the error returns an error and the current process stops. Equivalent to the following line of code:
SI PAS <Fonction HFSQL> ALORS DonneFocusEtRetourUtilisateur()
opEndProgramThe function that triggered the error returns an error and the program stops. Equivalent to the following line of code:
SI PAS <Fonction HFSQL> ALORS FinProgramme()
opRelaunchProgramThe program stops and the application is automatically restarted.
HFSQL Client/Server If a loss of connection occurs, to ask for reconnection, HReconnect must be used in the procedure called by HOnError.

Using a class method to customize the errors

<Name of procedure or window> can also correspond to a method of an object if HOnError is called in a method of this object. All you have to do is specify the name of the method to use (without using the object name as prefix).
If at the time of the method call by the HFSQL engine, the object used during the call to the HOnError function is no longer allocated, a fatal error is returned.
HFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses)

Customizing the default error windows

The default error windows are supplied (as well as their WLanguage code) for information in the "\Programs\Data\Preset windows\HFSQL - Automatic help windows" directory.
You can include these windows in your projects, customize them and pass them as parameters to the HOnErrorfunction.
WEBDEV - Server codeHFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Connectors (Native Accesses)

Customizing the default error pages

The default error pages are supplied (as well as their WLanguage code) for information in the "\Programs\Data\Preset pages\HFSQL - Automatic help pages" directory.
You can include these pages in your projects, customize them and pass them as parameters to the HOnErrorfunction.
Related Examples:
WD Managing HFSQL Errors Training (WINDEV): WD Managing HFSQL Errors
[ + ] The "WD Managing HFSQL Errors" example presents the management of HFSQL errors (duplicate, integrity).
This example explains how to customize the process when an error occurs.
Component: wd270hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment