PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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. See Assisted management of HFSQL errors for more details.
Windows Mobile The management of HFSQL errors must be programmed by HOnError. The management of HFSQL errors is not automatically taken account. HOnError is used to customize the management of HFSQL errors by running a specific procedure or window for example.
HFSQL Client/Server The automatic management of errors is not available for the stored procedures. HOnError can be used to manage the error via a procedure (stored procedure).
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 20 and later
WINDEVJava This function is now available for the Java applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
AndroidAndroid Widget Java Onlu the loss of connection can be customized.
New in version 20
WINDEVJava This function is now available for the Java applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
AndroidAndroid Widget Java Onlu the loss of connection can be customized.
WINDEVJava This function is now available for the Java applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
AndroidAndroid Widget Java Onlu the loss of connection can be customized.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEVWEBDEV - Server codeReports and QueriesWindows MobileUniversal Windows 10 AppAjaxUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Accesses
// Customize the lock errors
// The OnLockError procedure is called
// when a lock error occurs for all the files
HOnError("*", hErrLock, "OnLockError")
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Accesses
// Re-enable the automatic management
// of all the errors on all the data files
HOnError("*", hErrAll)
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppAjaxUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative Accesses
// Re-enable the automatic management
// of the lock errors on Customer file
HOnError("Customer", hErrLock)
Syntax
<Result> = HOnError(<File Name> , <Type of Error> [, <Name of Procedure/Window/Page>])
<Result>: Boolean
  • True if the operation was successfully performed,
  • False otherwise. HError returns more details about the problem.
<File Name>: Character string (with or without quotes)
Name of data file used. If this parameter is equal to "*" the customization will be applied to all data files found in the analysis or defined by programming.
<Type of Error>: Constant or combination of constants
Type of error to configure.
hErrDatabaseAccessConfigures the access errors to a HFSQL Client/Server database (access forbidden by HNoDatabaseAccess).
AndroidAndroid Widget Universal Windows 10 AppJava This constant is not available.
hErrLockConfigure the lock errors.
AndroidAndroid Widget Java This constant is not available.
hErrDuplicatesConfigure the duplicate errors.
AndroidAndroid Widget Java This constant is not available.
hErrIntegrityConfigure the integrity errors.
AndroidAndroid Widget Java This constant is not available.
hErrModifyConfigure a modification conflict.
AndroidAndroid Widget Java This constant is not available.
hErrPasswordConfigure the password errors (wrong password).
AndroidAndroid Widget Java This constant is not available.
hErrConnectionLossConfigure the errors caused by a loss of connection with the HFSQL server.
Universal Windows 10 App This constant is not available.
hErrIndexConfigures the indexing errors (re-indexing in progress during the file access).
AndroidAndroid Widget Java This constant is not available.
hErrNeedValueConfigure the errors caused by a mandatory input with no data (OLE DB and some native accesses).
AndroidAndroid Widget Universal Windows 10 AppJava This constant is not available.
hErrAllConfigure all previous errors (except hErrIndex).
AndroidAndroid Widget Java This constant is not available.
<Name of Procedure/Window/Page>: Optional character string
Corresponds to:
  • WINDEVWindows Mobile Name of window or procedure to call when a <Type of Error> error occurs.
  • 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.
  • Versions 20 and later
    AndroidAndroid Widget Java Name of procedure to call when a <Type of Error> error occurs.
    New in version 20
    AndroidAndroid Widget Java Name of procedure to call when a <Type of Error> error occurs.
    AndroidAndroid Widget Java Name of procedure to call when a <Type of Error> error occurs.
  • Parameter not specified. If "Enable the automatic HyperFileSQL 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.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.
    Note: To disable the automatic management of errors, you also have the ability to uncheck "Enable the automatic HyperFileSQL help" in the project. To disable the automatic management of errors, you also have the ability to uncheck "Enable the automatic HFSQL help" in the project.
Note: 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 codeWindows Mobile 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:
HOnError(<File Name>, <Type>, ...
"<Component>.<Name of Set of Procedures>.<Procedure Name>")

Window:
HOnError(<File Name>, <Type>, "<Component>.<Window Name>")

Page:
HOnError(<File Name>, <Type>, "<Component>.<Page Name>")
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.
Note: 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 code line:
IF NOT <HFSQL function> THEN ReturnToCapture()
AndroidAndroid Widget Java This constant is not available.
opEndProgramThe function that triggered the error returns an error and the program stops. Equivalent to the following code line:
IF NOT <HFSQL function> THEN EndProgram()
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).
When the method is called by the HFSQL engine, a fatal error occurs if the object used during the call to HOnError is no longer allocated.
WINDEVReports and QueriesWindows MobileUniversal Windows 10 AppHFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative 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\HyperFileSQL - Automatic help windows" directory.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.
These windows can be included in your projects, they can be customized and passed in parameter to HOnError.
WEBDEV - Server codeHFSQLHFSQL Client/ServerHyper File 5.5OLE DBNative 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\HyperFileSQL - Automatic help pages" directory.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.
These pages can be included in your projects, customized and passed in parameter to HOnError.
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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Windows Mobile wp230hf.dll
Java wd230java.jar
Linux wd230hf.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment