OldValue and NewValue
Posted: Wed 05 Nov 2008 12:07
Hello,
using C++ Builder6 and MyDac 5.20.1.14
i have problems with OldValue and NewValue
OnDataChange
the error is
And one else
RestoreUpdates() doesn't do anything
Only when i edit current field and don't put cursor to another field this function restore old value.
works but only with current record. i need to restore records since the button with MyTable1->ApplyUpdates() has been pressed
Thanks
using C++ Builder6 and MyDac 5.20.1.14
i have problems with OldValue and NewValue
OnDataChange
Code: Select all
void __fastcall TForm1::MyDataSource1DataChange(TObject *Sender,
TField *Field)
{
AnsiString UpdateStat[] = {"Unmodified", "Modified", "Inserted", "Deleted"};
Label1->Caption = UpdateStat[MyTable1->UpdateStatus()];
if (MyTable1->UpdateStatus() == usModified)
{
Edit1->Text = Field->OldValue; // i get an error when i put cursor to another field
Edit2->Text = Field->NewValue; // Field->Value - error too
// when i remove these two lines and put for example Edit1->Text = "yes" it works. So the problem these two lines
}
else
{
Edit1->Text = "Unmodified";
Edit2->Text = "Unmodified";
}
}
Code: Select all
'Access violation at address 00493D73. Read of address 00000034' RestoreUpdates() doesn't do anything
Code: Select all
MyTable1->RestoreUpdates();Code: Select all
MyTable1->RevertRecord();Thanks