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!
Connect with Us