- Lock mode
- Changing the mode
- Changing the method
- Changing the mode and the method
HMode (Function) In french: HMode
Not available
Not available with this kind of connection
Changes the mode and the method for locking data files.
// Change the mode of all data files HMode("*", hModeMulti) // Make the "Customer" data file inaccessible to other applications HMode(Customer, hModeMono)
Syntax
Modifying the lock mode Hide the details
<Result> = HMode([<Data file>, ] <Mode>)
<Result>: Integer constant Lock mode performed on the data file before modification. | | hModeMono | Single-user mode: the data files are entirely locked in read/write as soon as they are opened. This mode prevents the other applications from accessing the data files already opened by the current application. | hModeMulti | Multi-user mode: the data files are not locked when they are opened. The other applications can access the data files. |
<Data file>: Optional character string Name of the data file used. If this parameter corresponds to "*" or if it is not specified, the modifications will be applied to all the data files. <Mode>: Integer constant Lock mode that must be performed on the data file.
If only this parameter is specified, the management mode is applied to all data files. | | hModeMono (default value) | Single-user mode: the data files are entirely locked in read/write as soon as they are opened. This mode prevents the other applications from accessing the data files already opened by the current application. | hModeMulti | Multi-user mode: the data files are not locked when they are opened. The other applications can access the data files. |
Modifying the lock mode and the lock method (advanced use) Hide the details
<Result> = HMode([<Data file>, ] <Mode> [, <Method>])
<Result>: Integer constant Lock mode performed on the data file before modification. | | hModeMono | Single-user mode: the data files are entirely locked in read/write as soon as they are opened. This mode prevents the other applications from accessing the data files already opened by the current application. | hModeMulti | Multi-user mode: the data files are not locked when they are opened. The other applications can access the data files. |
<Data file>: Optional character string Name of the data file used. If this parameter corresponds to "*" or if it is not specified, the modifications will be applied to all the data files. <Mode>: Integer constant Lock mode that must be performed on the data file.
If only this parameter is specified, the management mode is applied to all data files. | | hModeMono (default value) | Single-user mode: the data files are entirely locked in read/write as soon as they are opened. This mode prevents the other applications from accessing the data files already opened by the current application. | hModeMulti | Multi-user mode: the data files are not locked when they are opened. The other applications can access the data files. |
<Method>: Optional integer constant Method for implementing the locks: | | hModeDirect (default value) | The implementation of locks has priority (over the modification for example). Therefore, a record on which several read operations are performed will not be modified but the locks are faster. | hModeReservation | Implementation of non-priority locks (advanced use) This method allows you to immediately modify a record on which several read operations are performed. This method is slower than the hModeDirect method. This constant is useful when an important number of locking read operations are successively performed on the same record. |
Remarks Lock mode By default, if the current project: - is associated with an analysis, the lock mode performed on the data files is the multi-user mode (the data files are not locked when they are opened, the other applications can access the data files).
- is not associated with an analysis, the lock mode performed on the data files is the single-user mode: the data files are entirely locked in read/write as soon as they are opened. This mode prevents the other applications from accessing the data files already opened by the current application.
To modify the lock mode used: - Open the project description window: on the "Project" tab, in the "Project" group, click "Description".
- Display the "Files" tab.
- Specify the lock mode that must be used ("Management mode of files").
Changing the mode Changing the mode cancels all the current locks applied to the data file. There is no need to close the data file to change mode. Changing the method Changing the method has no effect on the current locks applied to the data file. There is no need to close the data file to change method. Changing the mode and the method The change of mode and method is directly performed on the physical data file. Therefore, this change is applied to the data file and to all its aliases.
This page is also available for…
|
|
|
|