> If you have a field name and want to find which table it's in quickly and
> efficiently, is there anything better than the following:
>
> SELECT table1
> =AFIELDS(aArray1)
> FOR i = 1 TO ALEN(aArray1,1)
> IF myfield = aArray1(i,1)
> itsintable1 = .T.
> ENDIF
> IF itsintable1 = .T.
> SELECT table2
> =AFIELDS(aArray2)
> FOR i = 1 TO ALEN(aArray2,1)
> IF myfield = aArray2(i,1)
> itsintable2 = .T.
> ENDIF
>
> ...or is this what I have to do, unless I work around it?
If the tables are in the .DBC, then you could open the .DBC and
select objectname ;
from {DBC} ;
where objectid in ;
(select parentid from {DBC} where ObjectType = "Field" and
ObjectName = m.MyField) ;
into array laTables
/Paul