Inserting Photographs into my database

G

Guest

Access 2k

I want to insert photographs from a directory on my hard drive into my
database ( C:\PrivPics )

Is there some code I can assign to a button which will direct me to the
above folder and when a picture is selected,insert the picture into my form.
The form is based on a table with an OLE field for the picture

Any advice gratefullt recieved

Many thanks in advance

Simon
 
D

Dirk Goldgar

Simon One said:
Access 2k

I want to insert photographs from a directory on my hard drive into my
database ( C:\PrivPics )

Is there some code I can assign to a button which will direct me to
the above folder and when a picture is selected,insert the picture
into my form. The form is based on a table with an OLE field for the
picture

Any advice gratefullt recieved

Many thanks in advance

Simon

Are you really sure you want to insert the photos into your database as
OLE objects? This can lead to massive bloating in your database, as
Access will store the pictures are in a completely uncompressed bitmap
format. For most purposes it is *much* better just to store the path to
the image file, or even just the file name itself, when the folder path
is static or is stored elsewhere in a single record. You can use an
unbound image control to display the image when you want.

You can use the code at http://www.mvps.org/access/api/api0001.htm to
call the Windows File Open Dialog API for the purpose of having the user
select a file.

For a discussion of alternative image-handling techniques, see this
link:

http://accdevel.tripod.com/imaging.htm

For miscellaneous magic including some image management, poke around
here:

http://www.lebans.com
 
G

Guest

Reply to Simon for info:

Thanks very much for the link on how to call the windows file open dialog
box. I have all the VB code working to store the path and file name to my
jpeg files, but have been looking for just this bit of code so to that my
user (yes, there is only 1 user for the small system I am building; well, 2
if you count me) doesn't have to type in the file names for every file. The
database is very small with only about 13,000 records, but every one could
have a picture associated with them.

One of the challenges was to come up with a directory structure for storing
the pictures, so that all 13,000 of them don't end up in one directory.

Thanks again. You are a lifesaver.

Mike O.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top