Re: Display stored JPGs on a form



Thanks Bill

I understand that storing images in an Access database does not make for the
most efficient application but it is convenient. I stored over 200 JPGs
which bloated the size of the mdb file to 165 MB but that's okay with me.
The response time is fine and everything is self contained so I am happy.

My problem is trying to display my stored image on a form.

As I mentioned, I have a Bound Object Frame control on a form that has as
its control source the OLE Object type field in which the JPG is stored..

When I call up the form the image does not display, only a place marker. If
I click on the place marker the image will open in Internet Explorer or
whatever OLE server I have specified for JPGs.

Maybe this is the best Access can do?

However, if I remember correctly, one of the old sample apps that used the
Northwinds database stored employee pictures (image files) in the database
and got them to display on the form. I can't seem to find that old mdb file
though.

Is what I am trying to do possible?




"Bill" <billstanton@xxxxxxxx> wrote in message
news:n4-dncegRpqcFgjanZ2dnUVZ_gmdnZ2d@xxxxxxxxxxxxxxx
In all of what you've described, it isn't quite clear
exactly what you're trying to accomplish. But first,
I might suggest that you avoid storing images into
Access databases. Rather, establish an image
library, preferrably jpg images, and then link to
the image as driven by the database. You can do
this by creating an image control with its "Picture"
source left blank and then let the "Sections" OnFormat
Event set the link to the desired image.

Something like:
Me.MyImageControl.Picture = Me.[MyDBField]

Where: MyDBField is a fully qualified path to the desired
image. (Not the best idea to store fully qualified paths
as a database field, as it doesn't provide the flexibility
to move your image library around.)

Alternatively:
Dim strImagePath as String 'Of the form: "c:\MyAppl\"
Dim strImageLib as String 'Of the form: "MyImageLib\"

Me.MyImageControl.Picture = strImagePath & strImageLib & MyDBField &
".jpg"

Post back if this suggestion doesn't match what you're
trying to accomplish.

Bill


"Dave" <davefrick@xxxxxxxxxxxxxxxx> wrote in message
news:%23$bA4fKXIHA.484@xxxxxxxxxxxxxxxxxxxxxxx
I have a table with an OLE Object data type field in which I insert a
number of JPG files by simply copying the file and pasting it into the
table.

I create a form with a Bound Object Frame control that has as its control
source the OLE Object type field.

In Windows Explorer under Tools | Folder Options | File Types, I select
the JPG file type and change it from Internet Exploer to MS Office
Picture
Manager or Windows Picture and Fax Viewer.

After this all that appears on my form is the control with the image
name, no image itself. When I click on this control, Picture Manager
launches and displays the image just as Internet Explorer used to do
before I registered the JPG file type with Picture Manager.

But I want the image to display _in the form_.

I even tried creating an AutoForm referencing the image table as someone
in a different thread suggested. This produces the same result as above,
no image, just a linked file name in the control.

Has anyone else done this?





.



Relevant Pages

  • Re: Question on Alberts video regarding A2010
    ... The browser control works for both web based, ... Would I use this browser control the continues form to display the rooms? ... I just used the new picture control we have in access. ... those pictures are stored in database. ...
    (comp.databases.ms-access)
  • Load Picture from MS Access to VB6
    ... I have an app in VB6 that is connected to a MS Access 2000 database. ... contains pictures in possibly JPG, GIF or BMP format. ... Picture property of a Picture Box to a JPG or GIF file. ... Has anyone found something that works with DAO? ...
    (microsoft.public.vb.general.discussion)
  • Re: Display picture in Form
    ... It is usually a bad idea to store pictures as OLE objects in the database. ... not show the picture, even though the control property is set to Contents. ...
    (microsoft.public.access.forms)
  • Re: OLE Object- the real question
    ... There was an OLE control on the form which, when clicked, would ... database bloated to over 200Mb. ... rid of the OLE field and control. ... I'm now storing the path to the picture ...
    (microsoft.public.access.forms)
  • Re: Creating webpage with resized jpg images
    ... With a picture control, ... With appropriate calculations to determine size of thumbnail: ... all to be jpg. ...
    (microsoft.public.vb.general.discussion)

Quantcast