Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display OLE object in form?

Status
Not open for further replies.

lin

IS-IT--Management
Aug 27, 2000
13
0
0
US
Database has a field called photo where student/employee pictures are saved per record. I want to view these pictures on a form. All of the other info from that record appears, but not the picture.

The photo field data type is OLE. Any suggestions? [sig][/sig]
 
I know it's a daft question, but are you trying to display the form in datasheet view?

I have just tried a mock up of the same thing and I can find no problem. how are you storing the pictures? What type of picture format are they? [sig]<p>Phooey<br><a href=mailto:Andrew.j.harrison@capgemini.co.uk>Andrew.j.harrison@capgemini.co.uk</a><br>Otherwise known as Windy Bottom.[/sig]
 
No, I'm not trying to display the form in datasheet view. However, if I switch to datasheet view, I see long binary in the field.

The pictures were taken with a digital camera and used in another program to generate IDs. It doesn't give me an option to change or set the file format.
[sig][/sig]
 
How exactly are you entering the pictures into the table?

If the field is storing long binary data, then I presume that the OLE object is not being stored in an acceptable format. Would you be able to expand on the problem a little?

Meanwhile I hope this helps. :cool:

Here is a section taken from Access 2000 help...

Should I use a bitmap, metafile, or other graphic file to display a picture?
You can use bitmap files (.bmp or .dib extensions), metafiles (.wmf or .emf extensions), or other graphic files such as GIF and JPEG to display background pictures or pictures in bound object frames, unbound object frames, or image controls.
When to use metafiles
[ul][li]If you need to adjust the size of your picture, it's better to use a metafile.[/li][li] Metafiles scale better than bitmaps because they're made up of collections of lines rather than patterns of individual dots.[/li][/ul]
Metafiles are usually much smaller than bitmaps, so if you need to conserve disk space, use a metafile.
Many graphics programs allow you to save files as metafiles. See the documentation that came with your graphics program for details. Note that if you paste a bitmap into a graphics program and save it as a metafile, it will still be a bitmap — it's just embedded in the metafile. You must create the graphic in the graphics program and save it as a metafile.
When to use bitmaps
[ul][li]If scaling and disk space aren't concerns, or if you don't have access to a tool that creates metafiles, use a bitmap.[/li][li]If you want to create a tiled background picture, a bitmap will work well because it won't be scaled.[/li][li]If you want to be able to make small changes to the picture, use a bitmap. With bitmaps you have pixel-level control, so that you can make very small adjustments to the picture.[/li][/ul]
Notes
[ul][li]In forms and reports, if you need to adjust the size of a picture, set the PictureSizeMode property (background pictures) or the SizeMode property (bound object frames, unbound object frames, and image controls) to Zoom. When you set the PictureSizeMode or SizeMode property to Zoom, Microsoft Access retains the proportions of the picture when you size the form or control.[/li][li]In a data access page, use the Height and Width properties to adjust the size of a picture. In the Height and Width property boxes, enter values in pixels (px), points (pt), centimeters (cm) or inches (in). For instance, if you type 25px in the Height property box, the image will be 25 pixels high.[/li][/ul]

[sig]<p>Phooey<br><a href=mailto:Andrew.j.harrison@capgemini.co.uk>Andrew.j.harrison@capgemini.co.uk</a><br>Otherwise known as Windy Bottom.[/sig]
 
The pictures are being taken with a digital camera and are being saved to the database. Unfortunately the program that I'm using to capture the picture (ID Works) doesn't show an option to change the way the picture is saved (jpg, meta or bitmap). I'll check into this further, though.

Thanks [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top