ApplyUpdates Errors Calling ClentDataset Refresh

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
Posts: 24
Joined: Sat 14 May 2011 00:56

ApplyUpdates Errors Calling ClentDataset Refresh

Post by mmalinow » Thu 02 Aug 2012 13:23


You may want to disregard. It appears Refresh works fine. I just have a situation where the Change Count <> 0 when it is called. Causing an ApplyUpdates Before Refresh exception.

I am involved in maintaining a Delphi application originally written in Delphi 3 and using the BDE to acsess Oracle. Within the past 2 years we have migrated the code to Delphi 2010 and implemented the dbExpress driver for Oracle. We have seen some problems when calling ClientDatset.Refresh. In all cases our CDSs are and have been populated through TSQLStoredProcedure calls. We do DB updates by calling other package calls to Modify, Add etc. I am thinking that calls to CDS.Refresh are inappropriate based on how we are not directly connected to the DB through the CDS providers. What is your opinion?

Thank you,
Mike Malinowski

Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: ApplyUpdates Errors Calling ClentDataset Refresh

Post by AlexP » Fri 03 Aug 2012 10:23


When attempting to update an edited CDS before calling the ApplyUpdates method, an error occurs in the InternalRefresh standard method, since ChangeCount >0.
And since you are using stored procedures for retrieving data, you won't be able to call the ApplyUpdate method for this CDS, and update the edited CDS as well.

procedure TCustomClientDataSet.InternalRefresh;
if ChangeCount > 0 then <- True
DatabaseError(SRefreshError, Self); <- Error

Post Reply