Page 1 of 1

update failed error updates records????

Posted: Thu 06 Sep 2007 16:31
by GuzunNicolae
Hello

When I do Edit, Post and there are more than 1 matching records I get Update Failed: xx records found exception. Which is correct.

But as I've noticed it still does the update. It still updates that xx records. What I think is not correct. And I did not notice this earlier.

Tell me what to do to show you.

Thanks.

Posted: Fri 07 Sep 2007 10:51
by Antaeus
MyDAC cannot determine how many records will be modified before an update query has been performed. After an update command has been performed, MyDAC gets from the server count of the affected rows, and, if the value differs from one, raises an exception. To avoid this problem, you should wrap delete and update operations in transactions.

Posted: Fri 07 Sep 2007 14:45
by GuzunNicolae
I guess this does not matter if this is a TMyTable or TMyQuery component?

Posted: Fri 07 Sep 2007 15:15
by Antaeus
TMyTable is just a wrapper on TMyQuery, so there is no difference in this case.

Posted: Fri 07 Sep 2007 16:15
by GuzunNicolae
I see.
Not a good news, but thanks anyway :)