Microsoft KB Archive/133357

= Differences Between Temporary and Permanent Relationships =

Article ID: 133357

Article Last Modified on 2/15/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q133357



SUMMARY
Relationships between tables can be established to link the tables together based on matching values in a field common to all the tables. The relationships can be created to exist from one FoxPro session to another (permanent or persistent) or temporarily for each time a table is used. Each type relationship is created differently and exists or behaves, in Visual FoxPro, differently.

Generally, both types of relationships are used regularly in Visual FoxPro programming.



Permanent or Persistent Relationships
Permanent or persistent relationships can only exist between tables stored in a database container (as opposed to free tables). The relationship itself is stored within the database container and therefore can exist from one Visual FoxPro session to another until the relationship is explicitly terminated.

Persistent relationship can be created in the Database Designer using the table indexes (as opposed to using the table fields).

Because persistent relationships are stored in the database container certain functions can use these relationships as default links. Each time the tables involved in the persistent relationship are used in the Query, View, or Data Environment Designers, these persistent relationships are used as the default links. Persistent relationships are used to store referential-integrity information.

Temporary Relationships
Temporary relationships can exist between free tables or tables stored in a database container. However, temporary relationships cannot be created between a free table and a table in database container.

To create temporary relationships, use the SET RELATION TO command or create them visually in the View window. They must be recreated each time the table is used.

Another major difference between a Persistent and Temporary relationship is that the Temporary relationship causes the record pointer in the child table to move automatically when the parent record pointer moves.

