Mega Search
23.2 Million


Sign Up

Make a donation  
Forcing a not modified record to update database with TClien  
News Group: embarcadero.public.delphi.database.multi-tier

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

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 18-Mar-2014, at 3:21 PM EST
From: Elton Barbosa
 
Re: Forcing a not modified record to update database with TC  
News Group: embarcadero.public.delphi.database.multi-tier
There is any way to get the ClientDataSet generated SQL to update current record?

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 1-Apr-2014, at 4:57 PM EST
From: Elton Barbosa