Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's the difference?
Message
 
 
À
06/12/2007 10:22:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01273613
Message ID:
01273616
Vues:
12
First, the name in TO is the name of the field in the table you're setting reference from. IOW, in your case, 'myOrder' in SET RELATION is not the name of index in the second table 'table2' but the name of a field in 'table1' that relation is based on. The relation uses current index in the 'table2'. Its name is irrelevant for SET RELATION command.

When you enclose names in paranteses you make them 'Name Expression'. For Name Expressions VFP uses there values instead of names itself.
set relation to FIELD1_NAME into TABLE2_NAME
>I have two tables, contained in a DBC, that I'm trying to set a relation between.
>
>
>open database myDB1 share
>use myDB1!table1 order indexorder share in 0
>use myDB1!table2 order myOrder share in 0
>
>
>When I use this command I'm able to browse both tables and see the record pointer change in the second table.
>
>
>select table1
>set relation to myOrder into table2
>
>
>But if I try to use #DEFINES for the table and tag names, the second table ends up pointing to EOF. What's the difference?
>
>
>#DEFINE TABLE2_NAME 'table2'
>#DEFINE INDEX2_NAME 'myOrder'
>
>set relation to ( INDEX2_NAME ) into ( TABLE2_NAME )
>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform