How to Retrieve Table Properties in a ProgramID: Q130604 3.00 WINDOWS The information in this article applies to:
SUMMARYVisual FoxPro introduces new table properties (triggers, validation rules, and comments) that are available to fields in tables that belong to databases. This article describes how to look up these table properties by using a program.
MORE INFORMATIONThe new properties are available only if the table belongs to a database. You can use the DISPLAY DATABASE and LIST DATABASE commands to view, list to a file, or print all the table properties. The following examples apply only to the case where you want a program to retrieve the table properties to store in variables or for some other purpose.
Validation RuleUse the AFIELDS() or DBGETPROP() function to obtain the value of the Validation Rule table property. AFIELDS() places information about the table structure into an array. The syntax for AFIELDS() is:
Parameters:
DBGETPROP() retrieves several table properties. The following example shows
how to return the Validation Rule of a table by using the DBGETPROP()
function:
In this example:
Validation TextUse the AFIELDS() or DBGETPROP() function to obtain the value for the Validation Text table property. AFIELDS() creates a multi-dimensional array, the Validation Text is stored in column 11. The following example retrieves the Validation Text for a table named MYDATA.DBF:
The following example shows how to return the Validation Text of a table
by using the DBGETPROP() function:
Insert TriggerUse the DBGETPROP() function to obtain the Insert Trigger, as in this example:
Update TriggerUse the DBGETPROP() function to obtain the Update Trigger, as in this example:
Delete TriggerUse the DBGETPROP() function to obtain the Delete Trigger, as in this example:
Table CommentsUse the DBGETPROP() function to obtain the Table Comments:
Primary KeyUse the DBGETPROP() function to obtain the tag name of a Primary key, as in this example:
PathUse the DBGETPROP() or DBF() function to obtain the path to the table. The following example shows how to return the path of a table by using the DBGETPROP() function:
To obtain the path to a table by using the DBF() function, SET FULLPATH
must be used, as in this example:
Additional reference words: 3.00 VFoxWin
KBCategory:
KBSubcategory: FxprgTable
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |