Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Records from Two Tables Into a Grid
Message
De
27/01/1999 04:51:28
 
 
À
27/01/1999 04:06:29
Fida Shamsoodeen
Combined Systems (Pty) Ltd
Centurion, Afrique du Sud
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00180615
Message ID:
00180625
Vues:
21
>Can anyone please tellme how to do the following.
>
>I have table called Person.dbf which has two fields, code and name.
>The second table called Book.dbf which has many fileds but one
>field is called code which is the code from Person.dbf.
>
>I have set a relation between the two, but when I display the
>records in a grid, all the fields from book.dbf show in the grid,
>but the person.name does not show in the grid. It defaults to the
>first field in the book.dbf.
>
>Any suggestions

If you want to use a grid to show fields from multiple tables, you'll need to set the ControlSource property of each column individually, so that the Grid control loads data from the proper table and field in the correct order. If you're just setting the RecordSource to Book.DBF, there's no way for the grid to know that some data comes from Person and other data from Book. Setting the ControlSource for the fields explicitly lets you control which fields, from which tables, are shown in the grid.

An alternative would be to do a SQL Select or view that joined the tables and provided a single cursor containing fields from both tables - you could then use the cursor as the RecordSource for the Grid, and then the columns wouid inherit the fields from the cursor.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform