Exporting an embedded image to a file

G

Guest

Hi,

I have a client that's using embedded images in their database, in one field
in one table. The table has about 3000 records.

The DB backend size currently resides at 1.5GB. Removing this field and
performing a compact/repair reduces the backend to 2.7MB.

I could go through all 3000 records and save them manually, however it would
be much easier if I could do this using VBA. Most of the procedure I can do
myself, I'm just a little stuck on how to export an embedded image to a file
using VBA, and I'd be very grateful for any help.

Thanks in anticipation.

John Crighton
 
G

Guest

Graham, the writeblob function there looks like it'll do the job!

Thanks very much,

John.
 
S

Stephen Lebans

I just posted this last night.

http://www.lebans.com/oletodisk.htm
NEW - Dec 14/2005 ExtractInventoryOLE.zip A2K or higher ONLY! This
version saves the entire contents of a table containing OLE Objects to disk.
Does NOT require the original application that served as the OLE server to
insert the object. Supports all MS Office documents, PDF, All images
inserted by MS Photo Editor, MS Paint, and Paint Shop Pro. Also supports
extraction of PACKAGE class including original Filename. Contains function
to produce a full Inventory of the OLE field including LINKED path and
Filenames. Uses Structured Storage API's to read the actual contents of the
field.Version BETA 1.55
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
G

Guest

Stephen,

That looks like it's going to be incredibly useful (your things normally are
a godsend) - however, with this DB at least, most of the pictures that your
routine pulls out seem to have been cut in half and stuck back together the
wrong way round, or discoloured!

It does seem to bomb out partway through as well, but I suspect that may be
the data rather than your coding.

Thanks very much for the program though, it was very much appreciated.
 
G

Guest

Actually, scratch that - the version from 2002 does it all quite adequately.

Thanks again!

John.
 
S

Stephen Lebans

John I am always looking to add support for OLE Server apps not currently
supported. Could you make a copy of your table and delete all of the records
except a handful. Please Email it to:
(e-mail address removed)

The older solution from 2002 you are using does not extract the original
image. It extracts the Metafile presentation stream which is usually not an
identical copy of the original image. If you send me youir Tabel then I can
easily and quickly add support for your OLE object type.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

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