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
  • Password management
  • Creating or opening a data file
  • Opening a data file that is already opened
  • Managing the list of data files used (.REP)
  • Managing fatal errors
  • Opening a connection and the specified table
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Opens a data file.
Remark: Data file opening is automatically managed. However, in some cases, you may have to explicitly open a data file (to check the file existence or the password validity for example).
Example
// Ouvre le fichier de données Client
Client.Ouvre()
// Test du compte-rendu de la fonction <source>.Ouvre
IF Client.Ouvre("ABCD", hORead) = False THEN
	Error("Impossible d'ouvrir le fichier de données Client" + HErrorInfo())
END
Syntax
<Result> = <Source>.Open([<Password> [, <Access mode>]])
<Result>: Boolean
  • True if the data file was opened.
  • False if a problem occurred (wrong password, ...). HError is used to identify the error. HErrorInfo returns more details.
<Source>: Type corresponding to the specified source
Name of data file used (logical name, defined in the analysis).
<Password>: Optional string or Secret string
Password of the data file.
If no password is associated with the data file, you have the ability to use an empty string ("").
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
<Access mode>: Optional integer constant
Configures the access mode to the data file.
If this parameter is not specified, the data file will be opened according to its characteristics (if the data file is read-only, it will be opened in read-only ; if the data file is read/write, it will be opened in read/write mode).
hOReadThe data file can be accessed in read-only mode. It is only possible to read records. It is not possible to add or remove records.
hOReadWriteThe data file can be accessed in read/write mode. It is possible to read and write new records.

Hyper File 5.5 This parameter is ignored.
PHP This parameter is ignored.
Remarks

Password management

The password can be specified:
  • when the data file is opened with <Source>.Open,
  • before the data file is opened with <Source>.Password.

Creating or opening a data file

<Source>.CreateIfNotFound can replace <Source>.Open. Indeed, if the data file exists, it is automatically opened.

Opening a data file that is already opened

If <Source>.Open is used on a data file already opened with a different <Access mode>, the filters, locks and characteristics of the current iteration are lost.

Managing the list of data files used (.REP)

WINDEV Mobile allows you to update a list of data files used by the application (equivalent to the.REP file in WINDEV).
<Source>.Open specifies the list of data files used by the application (.REP for WINDEV and WEBDEV) if updates are enabled for this list.

Managing fatal errors

If a fatal error occurs when opening a data file, it may be interesting to continue the program while processing the error. To do so, we recommend that you perform the following exception process:
WHEN EXCEPTION IN
	Père.Ouvre()
DO
	Error("Erreur HFSQL : " + HError())
ELSE
	Trace("Fichier ouvert")
END
PHP Not available.
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)External languagePHPOLE DBNative Connectors (Native Accesses)

Opening a connection and the specified table

If necessary, <Source>.Open opens the connection to the database before opening the specified table. If the connection is already open (with the same parameters), this connection is automatically used.
Note: The default connection used corresponds to the connection associated with the table in the data model editor.
Component: wd300hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/16/2025

Send a report | Local help