Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grandchildren- how to setup in Views
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00414586
Message ID:
00414748
Vues:
19
Gerard,
Use the begin/end transaction. First save your child and get back its new primary key. Then add that to the foreign key field in the grandchildren and save those records. With the Transaction command if any of the saves don't work you can roll them all back.

Also, I added < pre > and < /pre > tags to make your code easier to read. Click on "Reply" to see how they work.

HTH
Barbara

>In my current (home-grown) Framework, I have in place classes
> which allow for Parents and Children and this works fine.
>
> I now want to set up a facility for Grandchildren as follows:
>
> Parent File:
> PK    Child  		Grandchild
> --	----		----------
> 1
> 2	2.1
> 	2.2		2.2.1
> 			2.2.2
> 	2.3
> 	2.4		2.4.1
> 			2.4.2
> 3
> 4
> I have been using views up to now and would like to continue to use these
> So in my child view, I just created the View, modified it,added records
> and then, during save of the form, populated the child view with the Parents
> Primary key and did a Table Update and everything went fine.
>
> Now with the Grandchild,as I go to each Child record and create the view,
> it uses the Child Primary Key. But each time I change the record on the
> Child Table, a NEW VIEW is created, which I dont really want, because
> it will get rid of the previous grandchildren details.
>
> I still want to click on a SAVE button to save any amendments/addtions
> to Parent,child or grandchild.
>
> I'm sure others have done this successfuly and am just looking for
> some ideas at this stage.
>
> Regards,
>
> Gerard
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform