>I am new to VFP and I have question on SET RELATION TO command/usage in context of application I've inherited.
>
>There is an .SCX (form) with following code in Load() method.
>
>SET RELATION TO ra_dcn INTO dd_dwgh IN dd_ecrapp
>
>dd_dwgh, and dd_ecrapp are database tables in app db.
>
>ra_dcn is field and index in dd_ecrapp table.
>
>My ?: How does it know which specific index field to relate to
>in dd_dwgh.
>
>The Primary key (index) for dd_dwgh table is DH_DCN. Both
>dd_ecrapp.RA_DCN and dd_dwgh.DH_DCN are integers.
>
>Am I corect in assuming that the dd_dwgh as child table gets
>its' PK field picked up by default for relation?
>
>Fred Z
It doesn't relate to a specific field. It relates to active index in child table (dd_dwgh). If there is no active index then relation is directly to recno() of child.
If dd_dwgh has no active index (ra_dcn integer) then each ra_dcn value is pointing to record#ra_dcn in dd_dwgh
Cetin