By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,573 Members | 938 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,573 IT Pros & Developers. It's quick & easy.

Storing JPG files

P: n/a
Does anyone have any advice as to how to get JPG images into an OLE
Object field? I have created a table that includes this data type,
and allowed Access wizzard to generate a form. I wish to copy various
images from the web (in my initial trials, I copied the files to my
PC), and which generally seem to be JPG files. However, Access
(Access 2000 ver 9.0.2720) does not seem to be able to cope with this.
When I attempt to insert the image (Insert | Object), the form
displays the filename, not the image (double-clicking at this point
does reveal the image, but Id rather not do this). I can convert the
JPG file to BMP using Paint, but the quality of the image is lost.
Possibly Im overlooking something. I was really hoping I could copy
& paste the image (ie. Ctrl-C, Ctrl-V) directly from the web and into
my database. Any help would be appreciated.

Ron
Nov 13 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
<st**********@netlink.com.au> wrote
Does anyone have any advice as to
how to get JPG images into an OLE
Object field?


The sample imaging databases at http://accdevel.tripod.com illustrate three
approaches to handling images in Access, and the download includes an
article discussing considerations in choosing an approach. Two of the
approaches do not use OLE Objects and, thus, avoid the database bloat, and
some other problems, associated with images in OLE Objects.

If you are printing the images in reports, to avoid memory leakage, you
should also see MVP Stephen Lebans' http://www.lebans.com/printfailures.htm.
PrintFailure.zip is an Access97 MDB containing a report that fails during
the Access formatting process prior to being spooled to the Printer Driver.
This MDB also contains code showing how to convert the contents of the Image
control to a Bitmap file prior to printing. This helps alleviate the "Out of
Memory" error that can popup when printing image intensive reports.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #2

P: n/a
> and allowed Access wizzard to generate a form. I wish to copy various
images from the web (in my initial trials, I copied the files to my
PC), and which generally seem to be JPG files. However, Access
(Access 2000 ver 9.0.2720) does not seem to be able to cope with this.
What are you planning to do with those images...?
When I attempt to insert the image (Insert | Object), the form
displays the filename, not the image (double-clicking at this point
does reveal the image, but I?d rather not do this). I can convert the
JPG file to BMP using Paint, but the quality of the image is lost.
Possibly I?m overlooking something. I was really hoping I could copy
& paste the image (ie. Ctrl-C, Ctrl-V) directly from the web and into
my database. Any help would be appreciated.


You really don't want to store images in a database. There are a lot
of really good reasons not to, but what people tend to do instead is
store the jpeg somewhere in the file system, and put a link to it in
the database. Then your form can open the image and display it when
you need to.
Nov 13 '05 #3

P: n/a
st**********@netlink.com.au wrote:
Does anyone have any advice as to how to get JPG images into an OLE
Object field? I have created a table that includes this data type,
and allowed Access wizzard to generate a form. I wish to copy various
images from the web (in my initial trials, I copied the files to my
PC), and which generally seem to be JPG files. However, Access
(Access 2000 ver 9.0.2720) does not seem to be able to cope with this.
When I attempt to insert the image (Insert | Object), the form
displays the filename, not the image (double-clicking at this point
does reveal the image, but Id rather not do this). I can convert the
JPG file to BMP using Paint, but the quality of the image is lost.
Possibly Im overlooking something. I was really hoping I could copy
& paste the image (ie. Ctrl-C, Ctrl-V) directly from the web and into
my database. Any help would be appreciated.

Ron


Example for handling images in Access 2000, do not use OLE objects,
store the path instead.
http://www.trevor.easynet.co.uk/down...Images2000.zip
--
This sig left intentionally blank
Nov 13 '05 #4

P: n/a

What are you planning to do with those images...?


I have been looking at real estate on the web. The info posted by
agents often includes images of the property. I intend to copy
various details (including the associated images) from the agents' web
sites from properties I am interested to an Access database. This
will allow me to add my own notes and make comparisons etc. The
images would remind me of the property better than the text.

It seems to me, but I may be in error, that storing the images in a
table(s) may be a cleaner method. Linking may be my final solution,
but I may well end up with thousands of pictures this way; though I
suppose separate sub-directories for each property may be okay.

Ron
Nov 13 '05 #5

P: n/a
> sites from properties I am interested to an Access database. This
will allow me to add my own notes and make comparisons etc. The
images would remind me of the property better than the text.
Very interesting! Is it working out?
It seems to me, but I may be in error, that storing the images in a
table(s) may be a cleaner method. Linking may be my final solution,
but I may well end up with thousands of pictures this way; though I
suppose separate sub-directories for each property may be okay.


Well it depends what your priorities are. Access isn't terribly good
about managing it's file-size to begin with, but if you send your
robot to collect everything it can find on real estate wherever you're
interested in, it's going to find tens or hundreds of thousands of
image files. When you store these in BLOBs in the database, you'll
have an mdb that's hundreds of megs or more. And the way Microsoft
uses scatter IO - tables written across the whote file - it's going to
take longer to query the more you find.

It'll still take space to store the files either way, but the file
system is optimized for this, and a database isn't. Access ( or SQL
Server ) will break the file apart into database pages and write it
out like that, then put it back together when you query it up.

You can store the files in sub folders by site, keyword, or whatever
is most interesting, and then have a field in your table that links
back to where the file is. The user could delete files through your
form, which will let you kill the row in your table and the file.
Nov 13 '05 #6

P: n/a

Very interesting! Is it working out?
Not yet. I got the download okay, but haven't had success with it.
As it is, when I open the form to display the images, it gets stuck on
the same image. I haven't yet investigated, but it behaves as though
the first image which is loaded is copied to each record in the table.
Despite the fact that I may have loaded three or four images, as I
move through subsequent records the same image is shown.

about managing it's file-size to begin with, but if you send your
robot to collect everything it can find on real estate wherever you're
interested in, it's going to find tens or hundreds of thousands of


I'm not going to get so sophisticated. These properties will consist
of either places I have personally inspected or ones I just want to
record for future reference (price comparisons). I'll go to the
agent's web site, and grab the details before they drop off the
agent's web site.

Ron
Nov 13 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.