문제

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