Board index » off-topic » Old value of field?

Old value of field?


2007-08-19 10:51:26 PM
off-topic19
Hi there
Take a TDatabase, TTable and a TDBEdit, displaying a field.
The user is editing the field, so MyTable.State = dsEdit.
MyTable.FieldNyName('myfield').AsString will hold the current new value as
entered by the user.
Is there any way to get to the old value of the field, the value that will
be restored, if MyTabel.Cancel is called?
I guess this question is not bde-specific? (I do use bde)
Thanks
Jacob
 
 

Re:Old value of field?

Save the field values to a variant array in the BeforeEdit event
handler. The only other alternative is to use a ClientDataSet and
DataSetProvider because TClientDataSet does provide access to the
original value.
--
Bill Todd (TeamB)
 

Re:Old value of field?

"Jacob Havkrog" < XXXX@XXXXX.COM >wrote
Quote
Is there any way to get to the old value of the field, the value that will
be restored, if MyTabel.Cancel is called?
you can enable cached updates for your TTable. Data Controls like TDBEdit
respond to ESC key by bringing the old value . Just remember to call
explicitly
ApplyUpdates().
Minas Harokopos
------
"Only the virtue's conquests have certainty" Sofokleous Erephyle
 

{smallsort}