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;
TDBRichEdit Conversion Error
-
AndreyZ
Re: TDBRichEdit Conversion Error
To solve the problem, you should create TStringStream with the correct encoding. Here is a code example:For more information about the correct usage of TRichEdit and TWideMemoField, please write to the Embarcadero support.
Code: Select all
procedure Tdm.StreamRE2WM(Source: TRichEdit; Target: TWideMemoField);
var
ss: TStringStream;
begin
ss := TStringStream.Create(Source.Lines.Text, TEncoding.Unicode);
try
ss.Position := 0;
Target.LoadFromStream(ss);
finally
ss.Free;
end;
end;-
craigtimms
- Posts: 3
- Joined: Tue 23 Apr 2013 17:26
Re: TDBRichEdit Conversion Error
The UniError disappears but the Richedit loses all it's formatting
-
AndreyZ
Re: TDBRichEdit Conversion Error
We do not develop TDBRichEdit, so this question is out of scope of our support. Please write about this problem to the Embarcadero support.