Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: CachedUpdates after ApplyRange



Permlink Replies: 1 - Last Post: Nov 9, 2015 12:42 AM Last Post By: Dmitry Arefiev
Oscar Castro

Posts: 5
Registered: 8/2/14
CachedUpdates after ApplyRange
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 6, 2015 2:40 AM
I am upgrading and old Delphi 7 BDE app to XE6 + FireDAC on PostgreSQL 9.3.

The code included many fragments as the following one (where tbAlbaCInci is a FDTable):

tbAlbaCInci.IndexFieldNames := 'CODPROV';
tbAlbaCInci.CancelRange;
tbAlbaCInci.SetRangeStart;
tbAlbaCInci['CODPROV'] := edCod.Text;
tbAlbaCInci.SetRangeEnd;
tbAlbaCInci['CODPROV'] := edCod.Text;
tbAlbaCInci.ApplyRange;
tbAlbaCInci.CachedUpdates := True;

But this doesn't work in the new environment. It only works when I switch the CachedUpdates and range order like this:

tbAlbaCInci.IndexFieldNames := 'CODPROV';
tbAlbaCInci.CancelRange;
tbAlbaCInci.CachedUpdates := True;
tbAlbaCInci.SetRangeStart;
tbAlbaCInci['CODPROV'] := edCod.Text;
tbAlbaCInci.SetRangeEnd;
tbAlbaCInci['CODPROV'] := edCod.Text;
tbAlbaCInci.ApplyRange;

That is, only when I set the CachedUpdates prop at any point before the SetRangeStart it works again. It seems that the ApplyRange method resets the CahedUpdates flag.

Is it a bug?

Edited by: Oscar Castro on Nov 6, 2015 2:41 AM
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: CachedUpdates after ApplyRange
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 9, 2015 12:42 AM   in response to: Oscar Castro in response to: Oscar Castro
It seems that the ApplyRange method resets the CahedUpdates flag.

It is opposite - setting CachedUpdates resets range. It is not a bug, but
a known (ok ... to me) limitation. Setting CachedUpdates to True turns
off Live Data Window mode. And this is done internally by Close / Open,
which resets range.

--
With best regards,
Dmitry
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02