PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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 Accesses Caution: The lock options will have no effect if the locks are not supported by the OLE DB provider or by the Native Access.
Windows Mobile This function can be used with HFSQL Client/Server data files or with data files handled by Native Accesses. This function is not available for HFSQL Mobile.
Java Access by JDBC: This function has no effect and it always returns the hModeMulti constant.
Versions 18 and later
Android Widget This function is now available in Android Widget mode (for the HFSQL data files).
Android This function is now available for the Android applications (for the HFSQL data files).
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode (for the HFSQL data files).
Android This function is now available for the Android applications (for the HFSQL data files).
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode (for the HFSQL data files).
Android This function is now available for the Android applications (for the HFSQL data files).
Universal Windows 10 App This function is now available in Windows Store apps mode.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Changes the mode for all the files
HMode("*", hModeMulti)

// Makes the "Customer" file inaccessible to the other applications
HMode(Customer, hModeMono)
Syntax

Modifying the lock mode Hide the details

<Result> = HMode([<File Name>,] <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 Accesses The result always corresponds to hModeMulti.
Java Access by JDBC: The result always corresponds to hModeMulti.
<File Name>: Optional character string (with or without quotes)
Name of 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 Accesses The mode used is hModeMulti.

Modifying the lock mode and the lock method (advanced use) Hide the details

<Result> = HMode([<File Name>,] <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 Accesses The result always corresponds to hModeMulti.
Java Access by JDBC: The result always corresponds to hModeMulti.
<File Name>: Optional character string (with or without quotes)
Name of 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 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. Display the description window of project ("Project .. Project description").Display the description window of project: on the "Project" pane, 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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Windows Mobile wp230hf.dll
Java wd230java.jar
Linux wd230hf.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment