Can Not Control TDBEdit->ReadOnly?

Hello!

Could any gurus follow below and suggest? Delphi4 has no such problem
while BCB5 does.

Thank you in advance!

CN
---------------
Add a TButton to the main form.
Add a TDatabase, TTable, TDataSource, TDBEdit and link them properly and
open them all.
Add the OnEnter event handler for TDBEdit:

void __fastcall TForm1::DBEdit1Enter(TObject *Sender)
{
 DBEdit1->ReadOnly=!DBEdit1->ReadOnly;
 if(DBEdit1->ReadOnly)
   DBEdit1->Color=clYellow;
 else
   DBEdit1->Color=clWindow;

Quote
}

When the program is running, click Button1 and DBEdit1 back and forth
for several time. When DBEdit1 becomes yellow, I can still change the
value in DBEdit1! This is weird! Also, when I go back from DBEdit1 to
Button1, error message happens:

"Table1 not in edit or insert mode."