ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Lock mode
  • Changing the mode
  • Changing the method
  • Changing the mode and the method
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
HMode (Function)
In french: HMode
ODBCNot available with this kind of connection
Changes the mode and the method for locking data files.
OLE DBNative Connectors (Native Accesses) Caution: The lock options will have no effect if the locks are not supported by the OLE DB provider or by the Native Connector.
Java Access by JDBC: This function has no effect and it always returns the hModeMulti constant.
Example
// 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.
hModeMonoSingle-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.
hModeMultiMulti-user mode: the data files are not locked when they are opened. The other applications can access the data files.

OLE DBNative Connectors (Native Accesses) The result always corresponds to hModeMulti.
Java Access by JDBC: The result always corresponds to hModeMulti.
<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.
hModeMultiMulti-user mode: the data files are not locked when they are opened. The other applications can access the data files.

OLE DBNative Connectors (Native Accesses) The mode used is hModeMulti.

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.
hModeMonoSingle-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.
hModeMultiMulti-user mode: the data files are not locked when they are opened. The other applications can access the data files.

OLE DBNative Connectors (Native Accesses) The result always corresponds to hModeMulti.
Java Access by JDBC: The result always corresponds to hModeMulti.
<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.
hModeMultiMulti-user mode: the data files are not locked when they are opened. The other applications can access the data files.

OLE DBNative Connectors (Native Accesses) The mode used is hModeMulti.
<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.
hModeReservationImplementation 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.

HFSQL Client/Server This parameter is ignored.
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:
  1. Open the project description window: on the "Project" tab, in the "Project" group, click "Description".
  2. Display the "Files" tab.
  3. 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.
Component: wd290hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help