>>>OPEN DATABASE MyDBC >>> >>>FOR EACH {table} IN MyDBC >>> ... >>>>>
>CLEAR >CLOSE DATABASES ALL > >OPEN DATABASE dat\data > >lnTableCount = ADBOBJECTS( laTables, "TABLE" ) > >FOR lnIx1 = 1 TO lnTableCount STEP 1 > lcTable = laTables[ lnIx1 ] > > USE ( lcTable ) > > lnFieldCount = AFIELDS( laFields ) > > FOR lnIx2 = 1 TO lnFieldCount STEP 1 > lcFieldName = UPPER( laFields[ lnIx2, 1 ] ) > > IF "REQUESTKEY" $ lcFieldName OR "REQFK" $ lcFieldName OR "RQFK" $ lcFieldName > ? lcTable + "." + lcFieldName > > ENDIF > > ENDFOR > > USE > >ENDFOR >Not as elegant but an alternative:
USE dat\data.dbc SHARED SCAN FOR objecttype = 'Field' AND ("REQUESTKEY" $ ObjectName OR "REQFK" $ ObjectName OR "RQFK" $ ObjectName) * Your code here, should include the search for ObjectID = ParentID to get the table name ENDSCAN[Update]Or a select statement to get the field and the parent and then scan the resulting cursor[/Update]