Board index » delphi » Q: Saving OLE Data to a BLOB field?

Q: Saving OLE Data to a BLOB field?

I wish to use the OLEContainer control to display a Word document, but
then I wish to save the Word document, as OLE data, in a Paradox database.

The purpose of this is to allow the user to store documents such as copies
of quotes etc. along with other company data in a sales database.

I notice the OLEcontainer has a SaveToStream method, and I see something
about TBLOBStream in the help files. But I could not see how to connect
the two together.

Any ideas anyone?

Basically, any examples of loading and saving OLE data to the Paradox
database would be helpful.

Thanks.

 

Re:Q: Saving OLE Data to a BLOB field?


Re:Q: Saving OLE Data to a BLOB field?


The following should work.

var    bs    : tBlobStream;

bs := tBlobStream.Create (tBlobField (aTable.FieldByName
(BlobTypeFieldName)), bmWrite);
try
    anOLEContainer.SaveToStream (bs);
finally
    bs.Free;
    end;

To load from the table, replace bmWrite with bmRead and SaveToStream with
LoadFromStream.

Quote
Steven Harris <stv...@cix.co.uk> wrote in message

news:memo.19990810085727.48033A@stv454.compulink.co.uk...
Quote
> I wish to use the OLEContainer control to display a Word document, but
> then I wish to save the Word document, as OLE data, in a Paradox database.

> The purpose of this is to allow the user to store documents such as copies
> of quotes etc. along with other company data in a sales database.

> I notice the OLEcontainer has a SaveToStream method, and I see something
> about TBLOBStream in the help files. But I could not see how to connect
> the two together.

> Any ideas anyone?

> Basically, any examples of loading and saving OLE data to the Paradox
> database would be helpful.

> Thanks.

Other Threads