Board index » delphi » Testing a record for Modified

Testing a record for Modified

Hi there,
How is it possible to test if the record that your are currently editing
with a TTable has been modified?

I have a record that the user is currently viewing/editing and if the user
has actually made any changes I need to be able to set a Modified flag to be
True in order for our replication program to work properly.

Currently we just set it to True regardless, which is not ideal cos
frequently the user could just be viewing the record without wanting to make
any changes.

Now, I know that there is a 'modified' propertly of the Table. This seems to
work ok apart from when it comes to Blob fields. These can be modified and
the modified property will not be set.

Is there any way around this?

Many thanks,

Stephen

 

Re:Testing a record for Modified


Hi Babbu!

Maybe use the event OnExit of the component that contains the Blob field.

Regards,

Rudy

Babbu Funk schreef:

Quote

> Hi there,
> How is it possible to test if the record that your are currently editing
> with a TTable has been modified?

> I have a record that the user is currently viewing/editing and if the user
> has actually made any changes I need to be able to set a Modified flag to be
> True in order for our replication program to work properly.

> Currently we just set it to True regardless, which is not ideal cos
> frequently the user could just be viewing the record without wanting to make
> any changes.

> Now, I know that there is a 'modified' propertly of the Table. This seems to
> work ok apart from when it comes to Blob fields. These can be modified and
> the modified property will not be set.

> Is there any way around this?

> Many thanks,

> Stephen

Re:Testing a record for Modified


I use the FormDestroy event:

procedure TLoadEditForm.FormDestroy(Sender: TObject);
// If data has altered set data_quality to 1 (valid) then post
//
begin
  if (quLoadEdit.State in [dsEdit, dsInsert]) then
  begin
    quLoadEdit.FieldByName('data_quality').AsInteger := 1;
    quLoadEdit.Post;
  end;
  quLoadEdit.Close;
end;

...but I haven't tested this with a blob field

HTH,Craig.

--
Craig Kinsman
cr...@KILLSPAMsystemcorp.iinet.net.au

Quote
>Babbu Funk schreef:

>> Hi there,
>> How is it possible to test if the record that your are currently editing
>> with a TTable has been modified?

>> Now, I know that there is a 'modified' propertly of the Table. This seems
to
>> work ok apart from when it comes to Blob fields. These can be modified
and
>> the modified property will not be set.

>> Is there any way around this?

Other Threads