saving a word document to a table

E

edward

Hi,

I have a table with an OLE Object type field
called "comment". I want to link or embed a word document
into this field using ADO.

Doing the following does not work:

With rst
.AddNew
.Fields("comment").Value = WordDocument
.Update
End With

Could you please tell me if this is even possible to do.
Almost all examples of setting an OLE Object involves
setting a control on a form and not actually saving the
object into a table using a recordset and ADO.

Thanks

Edward
 
S

SA

Edward:

There is no convenient or practical way to actually load an OLE object into
a blob (memo) field using ADO. This is because there's no again practical
way to construct the OLE header that is required; so normally you need to
use a form. That said, if you really want to store a Word doc in a Blob
field, then you would normally do it by reading byte chuncks of the file and
appending that to the bindary data stored in the field. You then "read
out" the binary data in reverse fashion. This is not very efficient.

Much more common and efficient is to simply store a path to the binary file
in the db (also reduced bloat) and load the file at run time.
 
D

david epsom dot com dot au

However, I think you will find that it is possible to
CHANGE the Word document stored in a Word OLE field,
if you have already set the field to hold a Word Document.

(david)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top