Thank you for your suggestion. However, it can only solve part of the problem when the code use TBlobField.Text.
Actually, even TDBMemo use AsString instead of Text when Load memo.
Code: Select all
procedure TDBMemo.LoadMemo;
begin
if not FMemoLoaded and Assigned(FDataLink.Field) and FDataLink.Field.IsBlob then
begin
try
Lines.Text := FDataLink.Field.AsString;
FMemoLoaded := True;
except
{ Memo too large }
on E:EInvalidOperation do
Lines.Text := Format('(%s)', [E.Message]);
end;
EditingChange(Self);
end;
end;
function TBlobField.GetAsString: string;
begin
// For backwards compatibility, read untyped data as Ansi.
// Use TWideMemoField for blobs associated with Unicode string data.
Result := string(GetAsAnsiString);
end;
So The OnGetText and OnSetText cannot make TDBMemo usable.
However, I understand the situation and appreciate your great effort spent to come out to the sad result of no possible solution within MYDAC. So I will settle with this result.
I had create my own version of TDBMemo, which add a property to distinguish using AsString / Text or AsWideString to load / save the text and it is working fine for a start but need more test to see if there are other problems.
Thanks again for your effort on resolving the issue.