OldValue and NewValue

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Aventurine
Posts: 3
Joined: Mon 03 Nov 2008 22:06

OldValue and NewValue

Post by Aventurine » Wed 05 Nov 2008 12:07

Hello,
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";
      }
}
the error is

Code: Select all

 'Access violation at address 00493D73. Read of address 00000034' 
And one else
RestoreUpdates() doesn't do anything

Code: Select all

MyTable1->RestoreUpdates();
Only when i edit current field and don't put cursor to another field this function restore old value.

Code: Select all

MyTable1->RevertRecord();
works but only with current record. i need to restore records since the button with MyTable1->ApplyUpdates() has been pressed

Thanks

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Re: OldValue and NewValue

Post by eduardosic » Wed 05 Nov 2008 15:55

try the last build of MyDAC.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 06 Nov 2008 07:48

We have fixed this problem in the latest MyDAC build (5.70.0.41). Please, upgrade to this build to solve the problem.

Post Reply