How to Determine the Database to Which a Table Belongs

Last reviewed: August 15, 1995
Article ID: Q134880
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0

SUMMARY

There are cases where a developer needs to be able to determine programmatically which database contains the table that is open. The CURSORGETPROP() function, with 'DATABASE' (including the quotation marks) as the first parameter, returns this information.

MORE INFORMATION

The CURSORGETPROP() function returns the settings of various properties of a Visual FoxPro table or cursor. For example, to determine the database to which a table belongs, you can use this code:

   USE customer
   WAIT WINDOW "The table in the current workarea is contained by " + ;
      CURSORGETPROP('DATABASE') + ' database'

Following is a list of all the properties for which CURSORGETPROP() returns settings:

BatchUpdateCount Buffering ConnectHandle ConnectName Database FetchMemo FetchSize KeyFieldList MaxRecords SendUpdates SourceName SourceType SQL Tables UpdatableFieldList UpdateNameList UpdateType UseMemoSize WhereType

For more information on using CURSORGETPROP(), please see the Visual FoxPro Help file.


Additional reference words: 3.00 VFoxWin
KBCategory: kbprg kbcode
KBSubcategory: FxprgTable


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: August 15, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.