Memo-Felder einer TTable kannst du so bearbeiten:
Delphi-Quellcode:
const
LT = 'LANGTEXT';
var
ms: TStream;
sl: TStrings;
n, nTotal: Integer;
begin
// ..
ms := TMemoryStream.Create;
sl := TStringList.Create;
nTotal := 0;
with VddTable1 do
while not Eof do
begin
TBlobField(TFieldByName(LT)).SaveToStream(ms);
ms.Position := 0;
sl.LoadFromStream(ms);
n := sl.Count;
sl.Text := Trim(sl.Text);
Inc(nTotal, n - sl.Count));
ms.Size := 0;
sl.SaveToStream(ms);
ms.Position := 0;
Edit;
if sl.Count = 0
then FieldByName(LT).Clear
else TBlobField(FieldByName(LT)).LoadFromStream(ms);
Post;
Next;
end;
sl.Free;
ms.Free;
// ...
end;
Getippt und nicht getestet.
Edit: Tippfehler korrigiert - danke @Peinhard