Forcing a not modified record to update database with TClien |
|
I have a table that, when the records are updated, it triggers events and calculated mechanisms in code and database.
Sometimes, I must trigger the events and calculated mechanisms in code when the user choice so, but have not changed the record at all. Maybe he changed the formula that calculated value to another table. But as the record is not changed at all, my TClientdataset do not fire the TDatasetProvider.onUpdateData.
Can I do something to tell the Clientdataset to force an update in a specific record of my choice?
First I tried to change a field to it same value, or modifying a value and change it back. Like this below (cdsCadastro is TClientDataset):
{code}
if (chkRecalc.Checked) then
begin
if not (cdsCadastro.State in [dsEdit, dsInsert]) then
cdsCadastro.Edit;
cdsCadastro.Fields[0].Value := cdsCadastro.Fields[0].Value+1;
cdsCadastro.Fields[0].Value := cdsCadastro.Fields[0].Value-1;
end;
{code}
But, despite the property Modified shows true, the events (like TDataSetProvider.onUpdateData) are not fired and no data is send to the database.
I thought that I could change the TClientdataset.Delta property, but I did not find documentation or examples on how to do so...
I'm using TDataSource -> TClientDataset -> TDatasetProvider -> TIBDataSet
|
Re: Forcing a not modified record to update database with TC |
|