Opens an analysis in HFSQL Classic format. This allows you to access the data files described in the analysis as well as the structure of these data files.
Reminder: A single analysis can be opened at a given time. If an analysis was already opened before the call to the function, this analysis is automatically closed as well as the associated data files.
Caution: When using HOpenAnalysis, the current HFSQL context is automatically reinitalized. The following operations are automatically performed:
- All opened data files are closed.
- All existing HFSQL views are deleted.
- All existing queries are deleted.
- All the declarations made with HDeclareExternal and HDescribeFile are deleted.
// Open the SALESMGT analysis
Opening an HFSQL analysis locally Hide the details
<Result> = HOpenAnalysis(<Path of .WDD> [, <Password>])
- True if the analysis was opened,
- False otherwise. HError returns more details about the problem.
<Path of .WDD>: Character string
Full path of ".WDD" file of analysis. This file contains the description of analysis to open.
If only the drive and the name of the analysis are specified, the analysis is sought in the current directory of the specified drive.
If neither the drive, nor the analysis path are specified, the analysis is sought in the current directory of the current disk.
The following syntax <Unit>:<Analysis name> is used to search for the analysis in the current directory of the specified drive.
<Password>: Optional character string
- Analysis password, defined in the data model editor.
- Empty string ("") if no password is associated with the analysis.
Starting an application associated with an analysis
- When starting an application, the analysis associated with this application is automatically opened. The analysis is sought in the main library of the application, then in the directory of the application.
To make sure the analysis is found, we advise you to include the analysis in the main library of the application.
- If HOpenAnalysis is called by an application associated with an analysis, this function:
- has no effect if the path of the specified analysis corresponds to the path of the analysis associated with the application.
- returns False if the path of the specified analysis does not exist. In this case, the application keeps working with the current analysis.
- opens the analysis and returns True if the specified analysis exists and if it is valid.
Starting an application not associated with an analysis
When an application that is not associated with an analysis is started, no analysis is automatically opened. It is therefore necessary to use HOpenAnalysis.
The analysis opened by HOpenAnalysis is searched:
- first, in the main library of the application according to its full physical name.
- then, on the current disk.
Opening an analysis this is already opened
HOpenAnalysis has no effect if the analysis opened by HOpenAnalysis is already opened.
Version of analyses opened with HOpenAnalysis
HOpenAnalysis cannot be used to open the analyses in Hyper File 5.5 format (and earlier). Only HFSQL Classic analyses can be opened.
To use HOpenAnalysis on Hyper File 5.5 files, you must use the " .WDD" file in an HFSQL Classic analysis containing files Hyper File 5.5 files. In this case, the ".WDD" file of the source WINDEV 5.5 analysis must necessarily be found in the directory of the executable.
You can also use HDeclare to directly handle a Hyper File 5.5 file.
Business / UI classification: Business Logic