TDBRichEdit Conversion Error
Posted: Tue 14 May 2013 10:32
I update a TWideMemo field by streaming using a TStringStream from a TRichEdit. Occasionally it works fine.
Usually it fails on the table.Post with a EUniError: Requested conversion is not supported
Parameter[0]: ACT_NOTES - invalid Value (Status = 2h)
Plain text always works....if I change the font colour or make it bold then *BAM* it bombs
Not clever.
Can anyone help me please
Here's the streaming code, which debugs fine, code falls over on the post:
procedure Tdm.StreamRE2WM(Source: TRichEdit; Target: TWideMemoField);
var
ss : TStringStream;
begin
ss := TStringStream.Create;
Source.Lines.SaveToStream(ss);
ss.Position := 0;
Target.LoadFromStream(ss);
FreeAndNil(ss);
end;
Usually it fails on the table.Post with a EUniError: Requested conversion is not supported
Parameter[0]: ACT_NOTES - invalid Value (Status = 2h)
Plain text always works....if I change the font colour or make it bold then *BAM* it bombs
Not clever.
Can anyone help me please
Here's the streaming code, which debugs fine, code falls over on the post:
procedure Tdm.StreamRE2WM(Source: TRichEdit; Target: TWideMemoField);
var
ss : TStringStream;
begin
ss := TStringStream.Create;
Source.Lines.SaveToStream(ss);
ss.Position := 0;
Target.LoadFromStream(ss);
FreeAndNil(ss);
end;