xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

NetDbUse()

Opens a database file for shared access in a work area.

Syntax

NetDbUse( <cDatabase>, ;
         [<cAlias>]  , ;
         [<nSeconds>], ;
         [<cRddName>], ;
         [<lNewArea>], ;
         [<lShared>] , ;
         [<lReadOnly>] ) --> lSuccess

Arguments

<cDatabase>
This is a character string holding the name of the database file to open. It can include path and file extension. The default file extension is DBF.
<cAlias>
This is the symbolic alias name of the work area as a character string. It defaults to the file name of <cDatabase> without extension.
<nSeconds>
Optionally, a numeric value can be passed specifying the amount of seconds to retry the operation before the function returns without success. It defaults to the return value of SetNetDelay().
<cRddName>
<cRddName> is an optional character string with the name of the RDD to use for opening the database file. It defaults to the return value of RddSetDefault().
<lNewArea>
This parameter defaults to .T. (true) which causes the function to open the database in the next unused work area. If .F. (false) is passed, the function opens the database in the current work area. If the current work area is used, all files are closed before the new database is opened.
<lShared>
This parameter defaults to .T. (true) which opens the database in SHARED mode. The the SET EXCLUSIVE setting is ignored.
<lReadOnly>
Specifying .T. (true) for <lReadOnly> opens the database in READONLY mode. The default value is .F. (false) which opens the file for read and write access.

Return

The function returns .T. (true) when the database is successfully opened, otherwise .F. (false) is returned.

Description

NetDbUse() is a network function used to open a database file in shared mode for multi-user access. If the database cannot be opened due to the file being locked by another process, the function retries the operation for a maximum of <nSeconds> seconds and prompts the user if the operation should be retried or aborted.

The function uses DbUseArea() and implements additional default logic for database usage in a network when the database cannot be opened at the moment. Refer to DbUseArea() for more information on opening a database file.

Info

See also:DbCloseArea(), DbUseArea(), NetOpenFiles(), RddSetDefault(), Select(), SET DEFAULT, SET PATH, Set()
Category: Database functions , Network functions , xHarbour extensions
Source:rtl\ttable.prg
LIB:xhb.lib
DLL:xhbdll.dll


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