Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Conditions for using <Source>.CancelDeclaration
  • <Source>.CancelDeclaration and closing the data file
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Used to:
// The Customer data file was declared beforehand in the analysis
// by HDeclareExternal
<Result> = <Source>.CancelDeclaration()
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurs. HError is used to identify the error.
<Source>: Type corresponding to the specified source
Corresponds to:
  • the name of data file (defined in the analysis). If this name is not specified, <Source>.CancelDeclaration handles the last data file used.
  • the name of query or data source associated with a query (when freeing resources once <Source>.ExecuteQuery or <Source>.ExecuteSQLQuery has been used).

Conditions for using <Source>.CancelDeclaration

This function must be used ONLY when the relevant data file (or query) is not used anymore!
In the following example, <Source>.CancelDeclaration is used too soon: the content of the Table control will be completely distorted. The Table control is populated using BuildBrowsingTable in a parallel process in the background. Therefore, <Source>.CancelDeclaration will be called before the table is entirely filled, making this table unusable.
HExecuteSQLQuery("test", "select * from customer")
BuildBrowsingTable(TABLE_Table1, "test")
Remark: The problem can also occur with a "data source" variable. A "data source" variable declared locally in a process or event (button click, procedure, method, etc.) ONLY exists while this code is run. For this reason, a "warning" is displayed when you are using this type of data source: "the data source will be destroyed at the end of this code".

<Source>.CancelDeclaration and closing the data file

To use <Source>.CancelDeclaration on a data file, this data file must be closed.
If a query, a subquery or a view uses the data file, <Source>.CancelDeclaration cannot be executed, even after calling <Source>.Close. The queries or views that are using the data file must be freed beforehand.
Component: wd290hf.dll
Minimum version required
  • Version 25
This page is also available for…
Click [Add] to post a comment

Last update: 10/26/2023

Send a report | Local help