xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

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
ValueDescription
0 *)Disables SHARE mode detection
1Opens database SHARED in a network, and EXCLUSIVE if no network is detected
2Always 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.

Info

See also:Set(), SET AUTOPEN, SET AUTORDER, USE
Category: Database commands , SET commands , xHarbour extensions
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe