Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AllowAddNew=.T. in 1-many Form. How to coordinate?
Message
From
21/09/1997 21:43:15
Shihchau Tai
Apic Systems Pte Ltd
Singapore, Singapore
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00050891
Message ID:
00050986
Views:
26
>>I don't like the idea of troubling the user to add child record shown in the samples. Therefore, I use AllowAddNew=.T. in my child grid. To maintain the 1-many relationship, I use a surrogated key. My question is: what is the best time to update the surrogated key to the child table so that the 1-many relationship is kept. I have to update the key some time after VFP automatically append a record, right?
>>
>>I also read that we can use a denormalize view for the 1-many form, ie. an updateable view of master-detail. Is that a better way? Any disadvantage?
>
>You should add the surrogate Foreign Key to your child record as soon as you can after the program does the Append Blank. If you can use INSERT instead, then you can add the foreign key at the same time as you add the new record. This way you never 'lose' the child record from it's parent.
>
>I do not like using a denormalized parent/child view because you have parent information on every record. If you are ONLY editing the child data, this is not a problem. If your user is editing parent data then you could have problems with conflicting data.
>
>Barbara

Thx for answering.

My problem is if I use AllowAddNew property in Grid, I don't need to 'Append Blank' or 'Insert'. It is done automatically. I can't find any event such as 'OnAdd'. That is why I don't know when to update the key. Do I have to do it manually (such as coding the INSERT in column of grid when user hit a particular key) so that I can update the surrogated key? Isn't this a basic feature of a DBMS?


Tai SC
Previous
Reply
Map
View

Click here to load this message in the networking platform