|
|
|
|
|
- Characteristics of created data file
- Additional files created
- Managing passwords
- Managing fatal errors when creating a data file
- Managing non-Latin character sets
- Replication: Range of Identifiers
- Priority for defining the location of log files
- Creating or opening an existing table
- Managing indexes
- Creating the data file from its description
<Source>.CreateIfNotFound (Function) In french: <Source>.CréationSiInexistant
Not available with this kind of connection
Performs the following operations: - If the data file does not exist, creates an empty data file (".FIC" extension) with the index file and the memo file if necessary.
The function is equivalent to <Source>.Creation. - If the data file exists, opens the data file.
In this case, the function is equivalent to <Source>.Open. To optimize the call to the function <Source>.CreateIfNotFound FUNCTIONfunction, the data file can also be opened only the first time it is accessed (using the constant hOuvertureDifferent).
Note: The automatic creation of non-existing data files can be enabled in the project description ("Files" tab of the project description, "Automatically create the data files when they are opened"). <Source>.CreateIfNotFound is automatically used if the data file does not exist when it is handled for the first time.
Client.CréationSiInexistant()
Syntax
<Result> = <Source>.CreateIfNotFound([<Password> [, <Path of the JNL file> [, <Path of the JournalOperation file>]] [, <Option>]])
<Result>: Boolean - True if the data file was created or opened,
- False if a problem occurs. HError is used to identify the error. If a fatal error occurs, a specific process is required to continue the program and to check whether the data file was created (see the Notes).
<Source>: Type corresponding to the specified source Name of data file to use. <Password>: Optional string or Secret string - Password associated with the data file.
- Empty string ("") if no password is used.
New in version 2025Secret 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.
<Path of the JNL file>: Optional character string Access path to the JNL file associated with the logged data file. This parameter is only taken into account if the data file is logged. In this case, <File name>JNL.fic will be created at the specified location.
<Path of the JournalOperation file>: Optional character string Access path to the JournalOperation file and to the JournalIdentification file associated with the logged data file. The JournalOperation file contains all the operations performed on the logged data file. This parameter is only taken into account if the data file is logged.
<Option>: Optional constant Optimize the opening of existing data files. | | hChangeCharset | The character set defined by ChangeCharset will be taken into account in the new data file. Sorts, searches or other types of operations performed on string keys (strings, characters, date and time) will use the new character set. | hDelayedOpening | If the data file already exists, it will be opened during the first access to the data file. If the data file does not exist, it is created and opened. | hNoLink | Integrity management Links are not updated on the server (creation, modification, deletion as the case may be). Reminder By default, when a data file is created, bindings are updated on the server.
|
Remarks Managing passwords The password can be defined: - when the data file is created or opened by <Source>.CreateIfNotFound.
- before the data file is created by <Source>.Password.Attention The password is independent of data encryption. The data encryption must be configured during the file description in the data model editor ("Details" tab).
Managing fatal errors when creating a data file If a fatal error occurs when creating a data file, it may be interesting to continue the program while checking whether the data file was created or not. To do so, we recommend that you perform the following exception process:
WHEN EXCEPTION IN
Père.CréationSiInexistant()
DO
Error("Erreur HFSQL : " + HError())
ELSE
Trace("fichier créé")
END
Creating the data file from its description The data file can be directly created from its description in the data model editor. To do so, select "Create the data file" in the context menu of the data file (in the analysis graph) and select the directory in which the data file must be created.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|