Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question on sending multi-table view changes to base tab
Message
De
28/04/1999 23:44:35
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00213186
Message ID:
00213297
Vues:
28
>i have a view that combines data from two vfp tables.
>
>the tables are related through a foreign key and the fk's are
>used as the inner join condition between the tables. here is
>how my code looks...
>
> create sql view MYVIEW ;
> as select ;
> TABLE1.PK , ;
> TABLE1.FK , ;
> TABLE1.COLUMN1 , ;
> TABLE1.COLUMN2 , ;
> TABLE1.COLUMN3 , ;
> TABLE2.COLUMN1 , ;
> from TABLE1 ;
> inner join TABLE2 ;
> on TABLE2.FK = TABLE2.PK
>
>i displayed the rows from the view in a grid.
>
>i can edit TABLE1.COLUMN2, TABLE1.COLUMN2, TABLE1.COLUMN3 and
>successfully update the base table. when i edit TABLE2.COLUMN1 the
>tableupdate fails.
>
>i have tried different combinations of dbsetprop and cursorsetprop
>calls to set the tables and fields that can be updated but i have not
>had any luck.
>
>thanks in advance for any insight on this...

For both tables to be updateable, they both need to have a pk in the result set. It doens't look like to me that your table 2 has one...

After it does, getting the view updateable is just a matter of setting the fields as updateable, and setting both keys as key fields.

If you are using the vew designer to do this, it should be easy. If you maintain your view in code using DBSETPROP, you should look at my utility here in the files section- eView. It makes maintaining views like this much easier.
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform