View Issue Details

IDProjectCategoryView StatusLast Update
0036164LazarusDatabase Componentspublic2020-03-16 20:57
ReporterAnderson Assigned ToJuha Manninen  
Status resolvedResolutionfixed 
Product Version2.0.4 
Summary0036164: TDBEdit.Modified is not setting
DescriptionThe "Modified" property is not setting to true after making a change to an TDBEdit component.
Steps To ReproduceSee sample or just try something like:

  if DBEditDBF.Modified then
    ShowMessage('DBF Modified')
    ShowMessage('DBF NOT Modified');

Made a sample code using IBX, Memdataset and TDBF
TagsNo tags attached.
Fixed in Revisionr62769
Attached Files


related to 0031820 resolvedJuha Manninen TDBEdit.Modified property don't reset after DataSet.Post 



2019-10-11 18:37

reporter (200,191 bytes)


2019-11-07 15:01

reporter   ~0119136

tested with Lazarus 2.0.6 and the bug stills there

Juha Manninen

2019-11-13 00:03

developer   ~0119249

I am not sure if the "Modified" property should be set for any DB aware controls. The DB itself is modified, not the control connecting to it.
A DB expert should comment on this one.


2019-11-23 13:12

reporter   ~0119448

Hi Juha Manninen, thx for your comment

I have a project running on Lazarus 1.8 and the Modified is stetted normally.

I have a logic the use "onExit" and "Modified" to do some stuff. On Lazarus 1.8 and early it's works good... on 2.0+ no..
I'm stuck on 1.8..


2019-12-04 19:21

reporter   ~0119616

Hello, found the issue related:

The problem is that "TDBEdit.UpdateData" is called after every change on the TDBEdit, so the "Modified := False;" is always executed...

If I remove the "Modified := False;" my code works fine.

Juha Manninen

2019-12-05 00:28

developer   ~0119617

Last edited: 2019-12-05 19:39

View 3 revisions

> The problem is that "TDBEdit.UpdateData" is called after every change on the TDBEdit
Do you mean after every keypress? Then it is called too often.

Please see the note by Soner in the related issue:
which is perfectly valid.
Making decisions based on TDBEdit.Modified is logically wrong. TField.Modified would indeed make more sense but implementing it may be tricky. Somebody with good DB knowledge should comment on this one.
[Edit] I reopened the related issue. Maybe we should indeed revert r56034 unless somebody comes up with a better solution.
The question is: If the Modified flag is not useful, why Andrey Korol and Soner wanted to reset it in the first place?

Ideal solution would be to reset TDBEdit.Modified only after DataSet.Post.


2019-12-06 22:12

reporter   ~0119668

Hi Juha Manninen thx for your answer.
I know it's not the best to use TDBEdit.Modified, but i'ts work for my logic.. I have a "refresh data" that is called at onExit, to optimize I call It only when it's "Modified"..

Now talking about TField.Modified it would be awesome..
I have a code in Delphi that checks "TField.OldValue" and "TField.NewValue" at DataSet.OnBeforePost for audit purposes, tried to replicate with Lazarus.. but the OldValue and NewValue are always the same...

Juha Manninen

2019-12-06 22:56

developer   ~0119669

> but the OldValue and NewValue are always the same...
Ohh! Could you please study the code and fix it? I don't personally work much with DBs.


2019-12-07 00:02

reporter   ~0119670

Sure, I can try


2019-12-13 01:55

reporter   ~0119810

Hi Juha Manninen

About the old/new value thing.. I need to make some changes on the DB.pas file..

This file is part of FPC and not Lazarus right?

Juha Manninen

2019-12-28 23:43

developer   ~0120118

Sorry I missed your question earlier.
Yes, unit DB is part of FPC project. You should create a separate patch and open a separate report for it. The issue can be marked as related to this one then.

Juha Manninen

2020-03-16 20:57

developer   ~0121630

I reverted r56034 in r62769. Authors of the related issue must justify better their request.

Issue History

Date Modified Username Field Change
2019-10-11 18:37 Anderson New Issue
2019-10-11 18:37 Anderson File Added:
2019-11-07 15:01 Anderson Note Added: 0119136
2019-11-13 00:03 Juha Manninen Note Added: 0119249
2019-11-23 13:12 Anderson Note Added: 0119448
2019-12-04 19:21 Anderson Note Added: 0119616
2019-12-04 23:49 Juha Manninen Relationship added related to 0031820
2019-12-05 00:28 Juha Manninen Note Added: 0119617
2019-12-05 00:28 Juha Manninen Assigned To => Juha Manninen
2019-12-05 00:28 Juha Manninen Status new => feedback
2019-12-05 00:28 Juha Manninen LazTarget => -
2019-12-05 00:32 Juha Manninen Note Edited: 0119617 View Revisions
2019-12-05 19:39 Juha Manninen Note Edited: 0119617 View Revisions
2019-12-06 22:12 Anderson Note Added: 0119668
2019-12-06 22:12 Anderson Status feedback => assigned
2019-12-06 22:56 Juha Manninen Note Added: 0119669
2019-12-07 00:02 Anderson Note Added: 0119670
2019-12-13 01:55 Anderson Note Added: 0119810
2019-12-28 23:43 Juha Manninen Note Added: 0120118
2020-03-16 20:57 Juha Manninen Status assigned => resolved
2020-03-16 20:57 Juha Manninen Resolution open => fixed
2020-03-16 20:57 Juha Manninen Fixed in Revision => r62769
2020-03-16 20:57 Juha Manninen Note Added: 0121630