ADBOBJECTS(laTable,"Table") FOR EACH lcTable In laTable USE (lcTable) FOR ji = 1 TO TAGCOUNT() ** store off however ** tag name from TAG(ji) ** tag expression from SYS(14,ji) ** PRIMARY(ji), CANDIDATE(ji), UNIQUE(ji) to find out type ENDFOR USE ENDFORYou can get the relationship information directly from the DBC, provided the DBC is not open exclusively at the time.
SELECT d1.objectname AS table_name, ; d2.objectname AS relation_name, ; d2.property, ; d2.riinfo ; FROM mydata.dbc d1 ; JOIN mydata.dbc d2 ; ON d1.objectid = d2.parentid ; WHERE d2.objecttype = "Relation" ; INTO CURSOR cuRelations USE IN mydataThe relationship is stored in the dbc as a child object of the table on the right side of the relationship description. e.g., Table1 has a 1-M or a 1-1 relationship to Table2. The Relation database object is a child of Table2.