Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Editing multiple records of a table in the same form
Message
De
16/09/2009 04:07:55
 
 
À
16/09/2009 02:21:12
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01424677
Message ID:
01424683
Vues:
50
Hi,

Thanks a lot for the illustrating codes.
I think using view is not wrong ... it just does not help to make things any easier in this case.


>Hi,
>
>number one skip the use of views. There are Cursoradapters and they are much better. No bloat of DBC. Easy redefine. Easy testing.
>
>Anyway, the problems are the same here.
>
>It will not work with n records of the same table.
>
>If n is a constant , there might be the way to create a fixed number views that point (SET RELATION) from the "many" table. So your business logic might create the records as well as to save and delete.
>
>One can update multiple tables from one view, but it would need to multiple update the same table multiple times. This would mean that the updatecode of the view need to determine wich field should write to wich part of the table?
>
>One might mimic, but you need to test yourself. See symbolic example (untested):
>
>use Many shared alias Many_1 in 0
>use Many shared again alias Many_2 in 0
>use Many shared again alias Many_3 in 0
>
>SELECT;
>OneTable.Fields,;
>Many_1.Fields,;
>Many_2.Fields,;
>Many_3.Fields;
>from OneTable;
>inner join Many_1;
>ON ..
>inner join Many_2;
>ON..
>inner join Many_3;
>ON..
>
>*not in each fields there have to be a key pointing to a unique record
>
>dbsetprop("YourView",'view','tables',"OneTable,Many_1,Many_2,Many_3")
>dbsetprop("YourView.OneTable_Key","field",'keyfield',.T.)
>dbsetprop("YourView.Many_1_Key","field",'keyfield',.T.)
>dbsetprop("YourView.Many_2_Key","field",'keyfield',.T.)
>dbsetprop("YourView.Many_3_Key","field",'keyfield',.T.)
>dbsetprop("YourView.OneTable_Key","field",'UpdateName,',"OneTable.Key")
>dbsetprop("YourView.Many_1_Key","field",'UpdateName,',"Many_1.Key")
>dbsetprop("YourView.Many_2_Key","field",'UpdateName',"Many_2.Key")
>dbsetprop("YourView.Many_3_Key","field",'UpdateName',"Many_3.Key")
>dbsetprop("YourView.OneTable_Key","field",'Updatable',.T.)
>dbsetprop("YourView.Many_1_Key","field",''Updatable',.T.)
>dbsetprop("YourView.Many_2_Key","field",''Updatable',.T.)
>dbsetprop("YourView.Many_3_Key","field",''Updatable',.T.)
>
>dbsetprop("YourView.OneTable_OtherField","field",'UpdateName,',"OneTable.OtherField")
>dbsetprop("YourView.Many_1_OtherField","field",'UpdateName,',"Many_1.OtherField")
>*....
>dbsetprop("YourView.OneTable_OtherField","field",'Updatable',.T.)
>dbsetprop("YourView.Many_1_OtherField","field",''Updatable',.T.)
>*...
>
>
>I would prefer the SET RELATIONS.
>
>Agnes
>>Hi,
>>
>>For tables that are linked by "one-to-many" relation, if I need to let user add and edit 1 record from the "one" table and multiple records from the "many" table, could it be possibly done by using a single view? Say the multiple means a fix N records, could it be possible to create a view when each time I add a record to the view, it adds 1 record in the parent table and N related records in the child table...
>>
>>Just in case, I can't use a grid for the "many" table because of presentation requirement.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform