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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Photos in Access

Status
Not open for further replies.

ElSteveO

Programmer
Nov 6, 2001
58
0
0
US
When I enter a photo into a form (using Access 2000) by right clicking on the photo object>insert object, I get a thumbnail photo that contains the photo's name. Why doesn't it take up the whole photo object? And why is the photo's name there too?

I tried this on the Northwind Database and the same thing happens, but the photos included in the DB are normal. Am I doing something wrong? I've tried JPG and BMP and get the same results.
 
You really should not attempt to store images in the Access tables. You will soon find your MDB size growing tremendously. Most of us will store the file name and path in a text field and then use some code to display the image in forms and reports as needed.

Duane
Hook'D on Access
MS Access MVP
 
thanks dhookum! that makes sense. I'll try to figure out how to do so.
 
FYI,
Access 2007 makes storing pictures in the database much easier, and has several features that drastically reduce the bloating.
If working in A2007, I am not sure if the old paradigm of never storing pictures in the db still holds. Ole images are now stored in a compressed format instead of .bmp format. It also can use an attachment data type which is a complex storage mechanism. I have seen quotes of a couple thousand images saved and still under 1G. In Access 2007 I see no reason to not store the images, if talking a reasonable number (few hundred depending on size of images).
 
ElSteveO . . .

Sorry to get back so late! To help solve your problem goto the following link:

Use images in your Access forms, reports, and controls

When the web page is open, scroll all the way to the bottom, the up slightly. Your looking for the [blue]Solve common display problems[/blue] section. This should get you thru your problem ... let us know how you make out ...

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Its becouse of wrong BMP file association (if you are inserting BMP). Registry key HKEY_CLASSES_ROOT\.bmp must be "Paint.Picture".

You can try an ActiveX control called AccessImagine ( ), makes adding images to database more convenient - you can load from file, scan, paste from buffer or drag-n-drop. You can crop image right inside the database and resample it automatically. It handles external image storage automatically if you need it.

"Be aware of WordPress, it provokes to write bloggy-style..." (c) Gunna
 
MaxDD, when I go to Hkey_classes_root\.bmp I see 5 different names. They are:

Default Reg_sz oisbmpfile
content type reg_sz image/bmp
perceived type reg_sz image
and two for Roxio

How do I actually change the key, and which of these do I change?

Thanks very much for the advice.
 
MaxDD, I figured out what you said and it worked! Thanks again to everyone.
 
Whoops, I spoke to soon. I have a line of code that says, "If Not IsNull(Me!Photo) Then Me.PaintPalette = Me!Photo_ObjectPalette"

It works great for the photos that are in the Northwind DB, but when I add my photo I get a run-time error 2196 saying, "Microsoft Access can't retrieve the value of this property." However, my photo shows up in the DB. Why am I getting this error?
 
ElSteveO, I forgot to mention that you need to change the (Default) value.

Why do you need that line about pallete? Isn't it some rudimental thing?

"Be aware of WordPress, it provokes to write bloggy-style..." (c) Gunna
 
That "pallete" code was in the Northwind DB. I just put a comment sign in front of that code and now I don't get that error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top