Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

stringlist and blob fields

327 views
Skip to first unread message

Wolfgang Kluge

unread,
Aug 16, 1999, 3:00:00 AM8/16/99
to
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


Ralph Friedman (TeamB)

unread,
Aug 16, 1999, 3:00:00 AM8/16/99
to
In article <37B7BD82...@tm.net.my>, Wolfgang Kluge stated:

> 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
>
procedure TFrmBlobBufr.BtnLoadFromFileClick(Sender: TObject);
var
myBlob: TBlobStream;
myList: TStringList;
begin
Table1.Edit;
myBlob := TBlobStream.Create(Table1Comments, bmReadWrite);
try
myList := TStringList.Create;
try
myList.LoadFromFile('BlobList.Pas');
myList.SaveToStream(myBlob);
finally
myList.Free;
end;
finally
myBlob.Free;
end;
end;

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)
--


Wolfgang Kluge

unread,
Aug 16, 1999, 3:00:00 AM8/16/99
to
Thanks Ralph, You saved my day.

"Ralph Friedman (TeamB)" wrote:

> procedure TFrmBlobBufr.BtnLoadFromFileClick(Sender: TObject);


markdav...@my-deja.com

unread,
Aug 16, 1999, 3:00:00 AM8/16/99
to

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.

0 new messages