Writing a little change log for our DB application, and I'm facing the following problem: in the BeforeUpdateRecord event of my DataSetProvider, the OldValue of any (modified) WideMemo field is missing.
It is present in the ClientDataSet before I ApplyUpdates, obviously, so somewhere in the creation of the delta or its unpacking by the DataSetProvider, it gets dropped.
How can I get that value?
Just in case it's relevant, here are the components I use
Client-side: TClientDataSet TDataSource
Server-side: TIBQuery TDataSetProvider
Connecting to a Firebird DB
Delphi Tokyo and Datasnap
Cheers!
I thought I would post this as a new answer as a new answer to what I now understand from the OP's comments to be his specific problem. What the OP wants to do is to catch the
OldValue
of a dataset field on the server side, that is at the IBQuery, rather than the client side of a TDatasetProvider. I will take my previous answer down once I'm sure the OP has seen this one.Consider the following code:
If the DataSetProvider has default settings,
IBQuery1BeforePost
is not called whenApplyUpdates
is called on the CDS connected to the DSP, because the process of applying updates bypasses the normal IBQuery editing process.However, if you set the DSP's
ResolveToDataSet
property toTrue
,IBQuery1BeforePost
DOES execute and correctly extracts the OldValue of theAValue
field, which is a WideMemo field in my setup. The reason the BeforePost code executes, of course, is that when ResolveToDataSet is set True, the usual IBQuery editing methods are used.Update Here are the project extracts I mentioned in a comment:
Code extract
DFM Extract
Table DDL