import image

O

Osyris

hi all ..

here is my question..

in a form of my data base i have field and a button..
i need when i click on the button to be able to import o picture in the
field choising from any folder in my pc.just like windows do when you want to
opoen a file..

thanks...
 
T

Tom Wickerath

Hi Osyris,

I have a demo database that is a progress-in-work (ie. not finished, by any
means) that shows you how to do this. The copy of the sample Northwind.mdb
database that ships with Access 2003 includes similar functionality on the
Employees form.

http://www.accessmvp.com/TWickerath/downloads/ImageDemo.zip

Notes:
My sample stores the path to the image, but does not import the image into
the database. Access 2003, and all prior versions, will suffer severe bloat
if you use the OLE Embedding technology to embed, rather than link, images.
There are ways around this problem, if you really need to store the image
within the .mdb file.

My sample does not work with Access 2000 and below, until I get around to
replacing the FileDialog code with the API method of calling the common file
dialog.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
L

Larry Linson

Osyris said:
in a form of my data base i have field and a button..
i need when i click on the button to be able to import o picture in the
field choising from any folder in my pc.just like windows do when you want to
opoen a file..

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.

And, Stephen has an ActiveX control available that works in cases where the
graphics filters are not available -- and works better, I've heard, than the
OLE Object and OLE Controls.

Please note that there are other approaches, e.g.,
Application.FollowHyperlink, but those, like OLE and Bound OLE Frames (which
from the symptoms you describe, are what you were / are using) still leave
you "at the mercy of the imaging software registered for the filetype").

Finally, Access 2007 has enhancements that, reputedly, eliminate the
database bloat long associated with OLE Objects and Bound OLE Frames. But,
it still leaves you relying on the software registered for the image type,
which may not be as "cooperative" as we'd like in creating our display. It
also has the capability of having a variable number of Attachments to a
Record, which may be helpful. But, as I have not done much with it yet, I
certainly wouldn't suggest you rush out and replace an earlier version --
not until the first Service Pack, at least.

Larry Linson
Microsoft Office Access MVP
 
Top