2

Is there a way to know if TAdoQuery in Edit state was changed?

Assuming we forced it into edit state, and we want to ask the user if he wants to keep the changes.

NGLN
  • 43,011
  • 8
  • 105
  • 200
none
  • 4,669
  • 14
  • 62
  • 102
  • Hi there, could you please re-accept the answer to the kobik's one, please ? I've answered something else; his answer is the right one. I'll delete my post from here, but I can't because it's blocked by the accept. Thank you! – TLama Apr 04 '12 at 15:12

1 Answers1

4

You have the TADOQuery.Modified property e.g:

if ADOQuery1.State in [dsEdit, dsInsert] and (ADOQuery1.Modified) then
  if KeepChanges then
    ADOQuery1.Post
  else
    ADOQuery1.Cancel;        
kobik
  • 21,001
  • 4
  • 61
  • 121