Possible bug in TDBRichEdit: causes EDatabaseError when losing focus

D5.01 Ent Ger, Delphi ADOUpdate2, W2k Sp2 Ger

I have serveral TDBRichEdit on a TPageControl, each one on a different
TabSheet. They are connected to a TADOQuery via a TDatasource.
When the Query is not in editmode and I jump from one TDBRichedit to
another by switching the TabSheets, I get a EDatabaseError saying that
the Query "is not in edit or insert mode" when the focus was on another
TDBRichEdit before.

This is the method that causes the error (DBCtrls.pas):

procedure TDBRichEdit.UpdateData(Sender: TObject);
   if FDataLink.Field.IsBlob then
     FDataLink.Field.Assign(Lines) else
     FDataLink.Field.AsString := Text;

The method sets a new value ignoring the fact that the Query is not in
editmode. As a result of this, "TCustomADODataSet.SetFieldData"
(ADODB.pas) raises an exception because "State" is not in "dsWriteModes".

Here's are parts of the stack that lead to the method above:

TCustomForm.SetFocusedControl // still ok, I guess
TPageControl.SetActivePage(...) // ok, that's what I wanted

I'm not really sure where the problem is, but I guess it's
TDBRichEdit.UpdateData, which writes to the Datalink without
checking the editmode.

Any ideas?
Many thanks for your help.




Remove all digits and spaces when replying to me:
email: contact56 at jens 4 berke54564 dot de53