Determining the Exclusive Status of an Opened Database

Last reviewed: November 21, 1995
Article ID: Q100443
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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.