- Managing the password
- 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
In french: <Source>.Ouvre
Not available with this kind of connection
Opens a data file.
Remark: The opening of data files is managed automatically. However, in some cases, you may have to explicitly open a data file (to check the file existence or the password validity for example).
// Open Customer data file
// Check status report of <source>.Open
IF Customer.Open("ABCD", hORead) = False THEN
Error("Unable to open the Customer data file" + HErrorInfo())
<Result> = <Source>.Open([<Password> [, <Access mode>]])
- 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 character string
Password of the data file.
If no password is associated with the data file, you have the ability to use an empty string ("").
<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).
|hORead||The data file can be accessed in read-only. You only have the ability to read the records. No record can be added or deleted.|
|hOReadWrite||The data file can be accessed in read/write. You have the ability to read the records and to write new records.|
This parameter is ignored.
This parameter is ignored.
Managing the password
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
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
Error("HFSQL error: " + HError())
This page is also available for…