Putting In BlobStreams is fairly easy, just remeber to create and destroy them.
 
e.g.
 
procedure TfmMain.Blob;
var
  slDesc : TStringList;
  bDesc  : TBlobStream;
begin
  {get contentsout of memo field in Table 1}
 slDesc:=TStringList.Create; //create string list
 bDesc:=TBlobStream.Create(TMemoField(Table1.FieldByName('FieldName')),bmRead); /*Create Blobstream for reading
 slDesc.LoadFromStream(bdesc); /* fill string list with blobstream contents
 bDesc.Free; /*destroy blobstream
 
{load contents into memo field of Table 2}
    try
     bDesc:=TBlobStream.Create(TMemoField (Table2.FieldByName('FieldName')),bmWrite); /*create blobstream for writing
     bDesc.Write(slDesc.GetText^,StrLen(slDesc.GetText));/*Load blobstream with string list contents
   finally
     bDesc.Free; /* destroy blobstreram
     slDesc.Free; /* destroy stringlist
  end; /* try - finaly block
end;
 
 
Nigel Tavendale
-----Original Message-----
From: Scott Cree <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Date: Friday, 29 January 1999 15:10
Subject: [DUG]: Memo strings

Hi All,

What is the best way to load a memo field (from an Access db) into a
stringlist object, and later save the stringlist back into the memo
field.
I have looked at the LoadFromStream method for TStrings, but I haven't
worked with streams yet, and I'm still trying to get to grips with them.

Cheers

__________________________
Scott Cree
Knowlysis Limited

Phone: +649-358-0017
Fax: +649-358-3534
E-Mail: [EMAIL PROTECTED]


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to