xHarbour Reference Documentation > Command Reference |
Defines network detection for shared file access.
SET AUTOSHARE TO [<nMode>]
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 |
1 | Opens database SHARED in a network, and EXCLUSIVE if no network is detected |
2 | Always opens databases EXCLUSIVE |
*) default |
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.
See also: | Set(), SET AUTOPEN, SET AUTORDER, USE |
Category: | Database commands , SET commands , xHarbour extensions |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
http://www.xHarbour.com