SET AUTOSHARE
Defines network detection for shared file access.
Syntax
SET AUTOSHARE TO [<nMode>]
Arguments
<nMode> A numeric value 0, 1 or 2 can be specified for <nMode>. The default is 0. If omitted, the network detection mode is switched off.
Description
SET AUTOSHARE is a compatibility command useful for changing a multi-user application to a stand-alone application by changing one line of code in the start routine of a program.
This requires changing only the value of <nMode>:
Values for SHARE mode detection --------------------------------------------------------- Value Description ----- ------------------------------------------------- 0 Disables SHARE mode detection ( default ) 1 Opens database SHARED in a network, and EXCLUSIVE if no network is detected 2 Always opens databases EXCLUSIVE
To take advantage of SET AUTOSHARE, an application must be programmed for multi-user access, respecting the rules for network programming. For example, record locks must be obtained with RLock() before changing field variables. This way, a multi-user application is created.
To change this application to a single user version, SET AUTOSHARE TO 2 is coded in the start routine.
A developer can SET AUTOMODE TO 1 on the development machine. In this case, performance advantages from EXCLUSIVE file access are available during the development cycle, while SHARED file access is granted in a multi-user environment.
Seealso
Set(), SET AUTOPEN, SET AUTORDER, USE