Board index » delphi » Update affected more than one record

Update affected more than one record

Hello All,

We are using a query of the form:    SELECT * FROM t WHERE  t.idfield
=:idfield

We get the above message when a dbedit is updated and the table has
either
no data in the column or all records have the same data. We don't get
the message if there
is data in a column. (The ADO patch has been applied)

Have tried the following, but no luck

   1. MarshallOptions = moMarshalModifiedOnly
   2. TADODataSet(Dataset).Properties['Update
Criteria'].Value:=adCriteriaKey;
   3. Provider flags: poAllowMultiRecordUpdates := False

Any Ideas - This is sortof serious!

Thanks,

    Tom

(ps. D5Enterprise, Datamodule using ADO + providers + TClientDatasets
      readying for 3 tier release but 2 tier currently whilst
developing.)

 

Re:Update affected more than one record


Quote
"Tom Conlon" <t...@2ls.com> wrote in message

news:3A3754AB.D62B92A1@2ls.com...
Quote

> We are using a query of the form:    SELECT * FROM t WHERE  t.idfield
> =:idfield

> We get the above message when a dbedit is updated and the table has
> either
> no data in the column or all records have the same data. We don't get
> the message if there
> is data in a column. (The ADO patch has been applied)

Maybe you have more than one row where
1. all field values are identical to the ones before you clear dbedit column
and post
2. all field values are identical, and the column bound to dbedit is null
already
....

In either case, "UPDATE affected more than one record" means that update
found more than one match for your WHERE clause in UPDATE statement - not
SELECT.

rb

Re:Update affected more than one record


Quote
>We get the above message when a dbedit is updated and the table has
>either
>no data in the column or all records have the same data. We don't get
>the message if there
>is data in a column. (The ADO patch has been applied)

You need to use tables that have a unique key if you want to update them.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Update affected more than one record


<My thanks to all responses but especially "Natalie Boodram"
<natal...@sirs.com>>

This may be of interest to others...

'Try setting pfInkey for the ProviderFlags for all fields in your
primary
key. Do this in the source dataset on your app server.'

Tom

Other Threads