Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem in deleting records in view
Message
From
24/12/1998 16:06:21
Eric Barnett
Barnett Solutions Group, Inc
Sonoma, California, United States
 
 
To
24/12/1998 13:30:08
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordan
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00170216
Message ID:
00170393
Views:
20
>>>I'm facing a very strange problem while deleting records in view...
>>>
>>>When I click on the child view grid to delete one rec. and save it...
>>>
>>>All the records are getting automatically deleted (for that one parent rec..)
>>>
>>>Anybody having any suggestions to solve this..
>>
>>How do you delete the record? Using any condition or simple DELETE? Is there any RI involved on DELETE?
>
>I just click on the delete mark, provided in grid to delete record..

Check your key field. Your key field must be a unique identifier (primary key) form an updatable view to work correctly. For example,

Structure of View

nKey I
nFKey I

Data:

nKey nFKey

1 1
2 1
3 1
4 2
5 2
6 3

nKey is the primary (unique) key. If I set up my view with nKey as the key field, delete and TABLEUPDATE() then only the records deleted are deleted, as expected. But if I set up my key field as nFKey (which I am not prevented from doing), then deleting record one and TABLEUPDATE() will actually delete records 1-3.

Hope this helps.
Eric Shaneson
Cutting Edge Consulting
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform