Use clientdataset to operate the Master/Slave table.
In the operation, del Main table (write the stored procedure in SQL and delete the sub-table with the ID field), the error update affected more than 1 record is reported, and the deletion cannot be submitted. An error is reported when a transaction is used!
After searching online for half a day, I found that none of them has a better Chinese answer.
However, I still found the English version. Haha ~!
The relationship between the master table and the sub-table and the corresponding relationship is created. If no error is reported, the deletion can also be submitted. Haha ~!
Attached English:
"Update affected more than 1 record" error
(In Delphi 2007)
Am using a clientdataset to manage editing of a simple record:
Employeeid (primary key)
Firstname (required)
Lastname (required)
Hiredate (required)
Exitdate (not required)
Nickname (not required)
Photo (image, not required)
Have one case where there are two records with the same employee
First/lastname but different keys and other values. Changing the value
Any field (e.g. Nickname) in one of these records and calling applyupdates
Generates "Update affected more than 1 record". I seem to get this error no
Matter what the provider flags are set to for the provider and client
Dataset (employeeid has pfinkey set). I don't understand because
Employeeid field shoshould uniquely identify which record to change.
How we set the provider flags for the dataset provider and for the fields
Doesn't seem to make any difference. Also, we 've been following the same
Format for all sorts of database tables previously and have not seen this
Error before now. Can anyone give me a direction to go in? No luck googling
This error and codegear's help is woeful.
Required thanks for your maintenance ance.
Jeff
Solved the problem:
Had a database trigger on the table that was not key specific. Updates
The dataset where firing this trigger which caused the error.
"Bill Todd" <no@no.com> wrote in message
News: 46fd9189$ 1@newsgroups.borland.com...
> Jeff W. wrote:
>
> Provider and client dataset (employeeid has pfinkey set). I don't
> Understand because the employeeid field shoshould uniquely identify
> Which record to change.
>
> You must set the providerflags on the source dataset (the one in
> DSP's dataset property) Not the CDs.
>
> --
> Bill Todd (teamb)