Problem Displaying .jpg Files In Ms Access

  • Thread starter Thread starter RStreet
  • Start date Start date
R

RStreet

Guest
PROBLEM DISPLAYING .JPG FILES IN MS ACCESS

We store .jpg image files in OLE data-type fields in MS Access 2002. We
display those images in forms and reports in Bound Object Frames.

PROBLEM: If we run MS Access on the Windows XP OS, the .jpg files will not
display in the Bound Object Frame. Instead, the file name of the .jpg file
id displayed. (Double clicking the file name will open the .jpg file in its
associated program.)

HOWEVER, if I either:

a) Replace the .jpg file with a .bmp file, the image displayes in the Bound
Object Frame.
b) OR

If I run the very same MS Access program on a Windows 2000 OS, the .jpg file
displays properly in the Bound Object frame.

QUESTION: What must be done in order to display .jpg files, stored in MS
Access 2002 tables in an OLE data-type field, in a Bound Object Frame?


Thank You for the response
RStreet
 
If your computer has 'Photo Editor' loaded, this is a key!!!!!!!!!!!!!
Igor.
 
Don't use bound objects if they exist on your computer's local drive (or if this is a shared DB, if they exist on the same hard drive where the DB resides).

Instead, look at Image controls - which are designed to display images.

In the image control, there is a property (I think it is "picture") where you just load the full file specification of the file you want to be in that image control. Don't allow the image to be embedded. Don't make it OLE. Make the image control unbound. Just fix the form to have a OnLoad event (i.e. form-level event that occurs between the time you load a new record and the time you refresh your display). In the OnLoad event, pick up the file spec of the image you want to see and load that to the .picture property.

You should look up image controls in your help files to see their many properties that include tiling, zoom/stretch, and aspect ratio lock, plus a few more important properties. Don't trust my feeble memory to have remembered all the features thereof.

You don't need "photo editor" loaded if your machine is Win98 or later because, whether or not you have Photo Editor, you will have Image Viewer. Not as spiffy as the photo editor, I'll admit, but it is all you need for .JPG images.

Now, there is one last issue... if your OLE links are in your database, how do you NOT use them as OLE...? You might have to write a specialized code routine for a one-time run that extracts the text of the OLE reference AS TEXT and stuffs it into another text field that you can use for file specs.

Remember, a file spec in this context consists of device, path, name, and type. We know type is .JPG from your question. Oh, this could also be in the form \\node\device\path\name.type - Access isn't the one that interprets the string anyway. Windows File System Services does that. So if it is legal for anything else, it'll be legal on Access.
 
We have the same problem with the jpg. If I open the jpg photo and then secure it to the database, it will show up on the report just right. If I don't open it, it only displays the file name in the report. DOC MAN, I would change this thing except it is a Commercial Off The Self (COTS) product that I'm not supposed to change (It is an ACCESS product that produces diplomas for an educational system). We only had the problem after Microsoft dropped the program that OFFICE had used before, and I could no longer use PCX files. Has anyone solved the problem???
 

Users who are viewing this thread

Back
Top Bottom