Dbase of photographs; not possible to store Jpeg

M

Mick B

Hi

I'd like to insert photographs into my productdatabase and i used OLE-object
as a datatype for the field i want to store Jpeg files. This doesn't work.
What is wrong with te picture?

Tx

Mick
 
J

Jeff Boyce

Mick

Access tends to excessive 'bloat' if fed a diet of JPGs or other images.
Instead of embedding the images in Access, add a field that holds the path
to the file, and when your form loads a record, get the image from the
location specified by the path.
 
T

Tim Ferguson

Exponent said:
This 'bloat' only occurs when using OLE Embedding. Access is
perfectly capable of storing jpeg and other images as raw binary data
with little or no overhead compared with the filesystem.

Okay: apart from a shameless plug for a commercial product in a public
newsgroup, I spotted this on your web page:
Implementing Raw Binary Storage

Images can be loaded from files into an OLE Object/binary field
(and extracted directly back to files) by using the ADO GetChunk
and AppendChunk methods in VBA or other languages. In this way
it is possible to display an image by extracting it to a
temporary file and then using conventional file-based approaches,
such as using the Access Image Control (though there are caveats
with this control).

While I am happy enough to accept the ADO error as a typo (AppendChunk and
GetChunk are DAO methods), I would be very interested to know whether you
have any references on how to accomplish this task in VBA. I am far from an
expert, but gave up on this after a week or so. I still guess that it is
theoretically possible, but I have never seen any working code that can
actually do it.

Can you provide evidence to back up your assertion here?

B Wishes


Tim F
 
E

Exponent

Larry Linson and Stephen Lebans both have VBA samples that you can try - links to both sites are on our
links page.

You can search the MS Knowledge Base for WriteBlob and ReadBlob, which deal with loading and extracting
binary data using GetChunk and AppendChunk in VBA.

GetChunk and AppendChunk are, in fact, ADO methods, as well as DAO.

I believe that the article is of general interest, and hardly a 'shameless plug'. It illustrates with
hard figures how raw binary avoids the bloat problem so frequently mentioned here in statements like 'Access
is inefficient at storing images', and it only briefly mentions our product as one possible solution.
 
K

kiln

Well, I agree with you. I wouldn't call your post or the article a
shameless plug, and the article is well written and informative. People
get too sensitive about posts like yours, IMHO, I'm glad you pointed out
a solution to the poster's issue.
 
T

Tim Ferguson

(e-mail address removed) (RSGinCA) wrote in

Aha: thanks for this. I'll take it away and study it...

Actually this was really the point of my post: having spent a huge amount
of time trying to get these methods to work and failing, and never having
seen a working example on anyone else's web site either, I started to have
doubts about whether it can actually be done without resort to C or C++.
BTW, his reference to AppendChunk and GetChunk as being ADO methods
was correct. While you are right that they are DAO methods, they are
also ADO methods.

I stand corrected. I hardly ever use ADO so what do I know..?

All the best


Tim F
 

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