Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: tClientDataset fails on ApplyUpdates


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0 Threads: [ Previous | Next ]
ken pfeiffer

Posts: 15
Registered: 5/11/98
tClientDataset fails on ApplyUpdates  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 23, 2016 11:34 AM
I am using Delphi 7 with Interbase 7.5. I have an app with TIBQuery, TDataSetProvider, and TClientDataSet.
This all works fine, EXCEPT I have noticed that when I update a large number of fields in the dataset, that the
updates are not applied. Here is the code I use:
try
OBStudyTable.Post;
if OBStudyTable.ChangeCount>0 then OBStudyTable.ApplyUpdates(-1);
OBStudyTable.Close;
except on E:Exception do ShowMessage('Exception is '+E.message);
end;
I am updating one row in a table that has hundreds of columns. Occasionally this
fails to update the dataset, but it does not throw an exception. So I added some
code:
try
OBStudyTable.Post;
showmessage('change count= '+intToStr(obstudytable.changecount));
if OBStudyTable.ChangeCount>0 then errorno:=OBStudyTable.ApplyUpdates(-1);
showmessage('errors in updating= '+intToStr(errorno));
OBStudyTable.Close;
except on E:Exception do ShowMessage('Exception is '+E.message);
end;
During normal operation this returns a ChangeCount of 1 and no errors, no exception.
But sometimes it returns a ChangeCount of 1 and an error number of 1628036 or
some other large number. But the data are still not lost. However, sometimes
it returns a change count of 1 and an error number of 1, and none of the data
are updated and there is no exception.

What is going on here? Is there a limit to the number of fields that can be
updated at once with TClientDataSet? Thanks for any help!
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02