I need to check and see if a validation rule exists on a table and/or field in FoxPro (to determine programmatically if it should be replaced/added/removed). DISPLAY STRUCTURE doesn't include any validation rules.

Is there a VFP command to list out validation rules on a table (to an array, file, cursor, anything)?

有帮助吗?

解决方案 2

You can use DBGETPROP to get information for a single DB-object/field:

? DBGETPROP("mytable.myfield","Field","RuleExpression")

or for a table:

? DBGETPROP("mytable", "Table", "RuleExpression")

其他提示

I found that AFIELDS() and COPY STRUCTURE EXTENDED both include field and table validation rules.

For AFIELDS() the table expression is stored on the first row of the array in column 10, and the field validation expression is stored with each row in column 7.

For COPY STRUCTURE EXTENDED the table expression is in the first row in a memo column called table_rule and the field expression is stored with each rule in a memo column called field_rule.

Another option is to use the GenDBC utility that comes with VFP. It generates a program that recreates the database.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top