How to: Create and Use Table Aliases
When you open a table, Visual FoxPro uses the file name of the table automatically as the default alias. Under certain conditions, Visual FoxPro assigns its own default alias. However, you can also create your own alias.
Note
After assigning a user-defined alias, you must use the alias to refer to the table thereafter.
To assign a user-defined alias to a table
- Open the table with the USE command, the table name, and the ALIAS clause with the table alias you want.
For more information, see USE Command.
To reference a field in an open table from another work area
- Preface the field name with table name or alias and a period (.) or the -> operator.
For example, suppose you want to access a field named Contact in a table named Customer that is open in a different work area. The following example illustrates how you can reference the field:
Customer.Contact
If the table you want to reference is opened with an alias, you can use the alias name. For example, if the Customer table is opened with an alias People, the following example illustrates how you can reference the Contact field with the alias:
People.Contact
See Also
Tasks
How to: Set Temporary Relationships Between Tables