Microsoft KB Archive/100443

{| = Determining the Exclusive Status of an Opened Database =
 * width="100%"|

ID: Q100443

2.50 2.50a | 1.02 2.00 2.50 2.50a WINDOWS | MS-DOS kbprg

The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5 and 2.5a
 * Microsoft FoxPro for MS-DOS, versions 1.02, 2.0, 2.5, and 2.5a

SUMMARY
Microsoft FoxPro has no function dedicated to determining the exclusive status of an opened database. Whether or not a particular database has been opened as exclusive or shared can be determined with the SYS(2011) function.

MORE INFORMATION
The SYS(2011) function is used to determine if the current record is locked. When used on a database that has been opened as exclusive, it will indicate that.

The following program demonstrates the use of the SYS(2011) function to determine if a database was opened as exclusive:

SET EXCLUSIVE OFF SELECT 0

USE customer.dbf SHARED IF UPPER(SYS(2011)) == 'EXCLUSIVE' WAIT WINDOW "Database opened as Exclusive" ELSE WAIT WINDOW "Database opened as Shared" ENDIF

USE customer.dbf EXCLUSIVE IF UPPER(SYS(2011)) == 'EXCLUSIVE' WAIT WINDOW "Database opened as Exclusive" ELSE WAIT WINDOW "Database opened as Shared" ENDIF Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a 2.x KBCategory: kbprg KBSubcategory: FxprgGeneral Keywords         : FxprgGeneral Version          : 2.50 2.50a | 1.02 2.00 2.50 2.50 Platform         : MS-DOS WINDOWS
 * }