https://sourceforge.net/p/zeoslib/tickets/560/
1, blob.Clear seems to work as intended.
Code: Select all
ZMemTable1.FieldDefs.Add('ID', ftLargeint, 0, True);
ZMemTable1.FieldDefs.Add('Name', ftString, 255, True);
ZMemTable1.FieldDefs.Add('Data', ftBlob);
ZMemTable1.Open;
ZMemTable1.Append;
ZMemTable1.FieldByName('ID').AsLargeInt := 1;
ZMemTable1.FieldByName('Name').AsString := 'Hello';
ZMemTable1.FieldByName('Data').AsBytes := TEncoding.Unicode.GetPreamble; // Just put something in
ZMemTable1.Post;
ZMemTable1.Edit;
ZMemTable1.FieldByName('Data').Clear;
ZMemTable1.Post;
If ZMemTable1.FieldByName('Data').IsNull Then ShowMessage('Blob is null')
ELse ShowMessage('Blob is not null');
2, Setting text for Blob, see comment in TBlobField.SetAsString:
// Use TWideMemoField for blobs associated with Unicode string data.
Don't use ftBlob for TDBMemo, use ftMemo or ftWideMemo instead.