How to Retreive Database Properties in a ProgramID: Q130345 3.00 WINDOWS kbprg The information in this article applies to:
SUMMARYVisual FoxPro introduces several database properties available to databases. These properties include comments and stored procedures. This article describes how to determine database properties from a Visual FoxPro program.
MORE INFORMATIONThe DISPLAY DATABASE and LIST DATABASE commands can view several database properties at once. These commands can direct output to the console, to a printer, or to a text file. The example in this article retrieves individual components of a database.
CommentA database comment can be obtained by using the DBGETPROP() function. The following example shows how to return the comment of a database by using DBGETPROP():
The parameters are:
VersionThe version number of a database can be obtained by using DBGETPROP() function. The following example shows how to return the version number of a database by using DBGETPROP():
The parameters are:
PathThe path to the database can be obtained by using the DBC() function. The following example shows how to return the path of a database by using DBC():
Stored ProceduresStored procedures contained within a database can be obtained by using the DISPLAY PROCEDURES or COPY PROCEDURES command. There is no way to store the contents of stored procedures in a memory variable. DISPLAY and COPY PROCEDURES can both be used to copy stored procedures to a text file or to the printer. The following example uses COPY PROCEDURES to copy the stored procedures to a file named STORCODE.TXT:
TablesA list of tables contained within a database can be obtained by using the DISPLAY TABLES or LIST TABLES command to display the list to the console, a printer, or a text file. Here's an example:
ViewsA list of views contained within a database can be obtained by using the DISPLAY VIEWS or LIST VIEWS command to display the list to the console, a printer, or a text file. Here's an example:
Named ConnectionsA list of named connections contained within a database can be obtained by using the DISPLAY CONNECTIONS or LIST CONNECTIONS command to display the list to the console, a printer, or a text file. Here's an example:
Additional reference words: 3.00 VFoxWin
KBCategory: kbprg
KBSubcategory: FxprgTable
|
Last Reviewed: May 1, 1996 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |