I had an issue in with FNC Data Grid hooked to an Aurelius Dataset which contains Blob fields.
The database was imported in to TMS Data Modeler which was used to create Aurelius classes.
The Blob field led to this code in the Aurelius class:
[Column('DESCRIPTION', [TColumnProp.Lazy], 4096)]
[DBTypeMemo]
FDescription: TBlob;
[If I would change the DBTypeMemo attribute to DBTypeWideMemo I get a malformed string message in the application.]
The blob type in the Aurelius Dataset is detected as ftMemo.
If I hook up the field to a FNC Data Grid column I cannot edit the value in the application.
I need to change the BlobType to ftWideMemo, then I can change it, but national character (e.g. German Umlaute äöü) are not persisted.
In order to make it working I must implement the following two handlers for the Aurelius Dataset memo field:
procedure TDM.ADSExamDescriptionGetText(Sender: TField; var Text: string;
DisplayText: Boolean);
var
Bytes: TBytes;
begin
Bytes := Sender.AsBytes;
if Length(Bytes) > 0 then
Text := TEncoding.UTF8.GetString(Bytes)
else
Text := '';
end;
procedure TDM.ADSExamDescriptionSetText(Sender: TField; const Text: string);
var
Bytes: TBytes;
begin
Bytes := TEncoding.UTF8.GetBytes(Text);
Sender.AsBytes := Bytes;
end;
Then, everything seems to be working as it should out of the box.
Can anyone tell me what I do wrong, or is it supposed to be that "complicated" to work with firebird blob text fields and Aurelius Datasets in combination witht the FNC Data Grid?