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
  • Lock mode
  • Changing the mode
  • Changing the method
  • Changing the mode and the method
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
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) Attention: If the OLE DB provider or Native Connector used does not support blocking, the blocking options will have no effect.
Java JDBC access: This function has no effect and always returns the constant hModeMulti.
Example
// Change le mode de tous les fichiers de données
HMode("*", hModeMulti)

// Rend le fichier de données "Client" inaccessible aux autres applications
HMode(Client, 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: data files are completely locked for reading and writing 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: data files are not blocked when opened. The other applications can access the data files.

OLE DBNative Connectors (Native Accesses) The result always corresponds to hModeMulti.
Java Access via 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: data files are completely locked for reading and writing 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: data files are not blocked when 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: data files are completely locked for reading and writing 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: data files are not blocked when opened. The other applications can access the data files.

OLE DBNative Connectors (Native Accesses) The result always corresponds to hModeMulti.
Java Access via 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: data files are completely locked for reading and writing 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: data files are not blocked when 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 locking mode applied to data files is single-user: data files are completely locked for reading and writing 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. To do so, go to the "Project" tab, "Project" group, and click "Description".
  2. Display the "Data 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: wd300hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help