>>>>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.
Thanks !! U r right, problem is this only...
I'm having one parent table and 2-3 child tables, file structure is :-
Parent table :-
Primary Key
Master Value
Child Table :-
Foreign Key (Parent's Primary Key)
Child Value
I'm not having primary key field in child tables, only foreign key which relates it to parent...
Pls advs. how I can solve this.. as if I remove key field, none of the fields are updatable...
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement