Can anyone give me a hint on how to store a stringlist in a table ( blob
field ? ) and later on retrieve it?
Thankful for any assistence
Wolfgang Kluge
procedure TFrmBlobBufr.BtnSaveToFileClick(Sender: TObject);
var
myBlob: TBlobStream;
myList: TStringList;
begin
myBlob := TBlobStream.Create(Table1Comments, bmRead);
try
myList := TStringList.Create;
try
myList.LoadFromStream(myBlob);
// Manipulate the list here.
finally
myList.Free;
end;
finally
myBlob.Free;
end;
end;
--
Regards
Ralph (TeamB)
--
"Ralph Friedman (TeamB)" wrote:
> procedure TFrmBlobBufr.BtnLoadFromFileClick(Sender: TObject);
Wolfgang,
The simplest way is to use the .AsString property
of the TField class.
procedure Example;
var
MyList : TStringList;
begin
MyList := TStringList.Create;
try
MyList.LoadFromFile('test.txt');
MyTable.FieldByName('MyBlobField').AsString :=
MyList.Text;
MyList.Clear;
MyList.Text :=
MyTable.FieldByName('MyBlobField').AsString;
ShowMessage( MyList.Text);
finally
MyList.Free;
end;
end;
Mark
In article <37B7BD82...@tm.net.my>,
Wolfgang Kluge <wkl...@tm.net.my> wrote:
> Good afternoon.
>
> Can anyone give me a hint on how to store a
stringlist in a table ( blob
> field ? ) and later on retrieve it?
>
> Thankful for any assistence
>
> Wolfgang Kluge
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.