Picture database design

G

Guest

I am working on a database to store information about photographs and want to
include the actual photo as part of the information stored for forms and
reports. I have read several forum threads and the article "Use images in
your Access forms, reports, and controls"
http://office.microsoft.com/en-us/assistance/HA011472041033.aspx?mode=print

The photographs are stored on multiple hard drives including external drives
that might not be available at all times. Since the actual photograph might
not be available I thought I would create low quality, but small files of all
the photos and either store them in the database as .bmp files or in a
sub-directory that the database could access.

I have had problems with both approaches. On page 5, the article indicates
that it should be possible to store .bmp files in a table. However, I get
the word "Package" rather than 'Bitmap Image" and the forms display a small
icon plus the file name. The article says that there are problems with other
formats but that .bmp should work. What am I doing wrong?

The other approach I tried was small .jpb images stored in a sub-directory.
On the bottom of page 5, the article says that relative paths should work. I
like the idea of relative paths because moving external drives makes an
absolute location risky. I can get a complete path to work and I can get
just a filename to work if the image is in the same folder as the database.
However, if the images are in a subfolder to the Access database folder I
can't get it to work with a relative path. Here is an example:

If the database is stored in: C:\My Documents\PhotoDatabase and there is a
subfolder with the path C:\My Documents\PhotoDatabase\Photos

I can put the pictures in C:\My Documents\PhotoDatabase and open the image
with the filename only. Or, I can put images in C:\My
Documents\PhotoDatabase\Photos and call them with the complete path.
However, if I try to use a shortcut like this: Photos\filename.jpg it doesn't
work. Am I doing something wrong or did I misread the artcile?

Thank you for your help.

David
 
R

Roger Carlson

You can always find the folder where the database currently is by using
this:
pathname = CurrentProject.Path
Therefore, you can set the path to the your pictures with this:
Me.ImgStock.Picture = pathname & "\" & PictureNameVariable

This way, no matter where the database is, as long as the pictures are in a
subfolder, it will find them.

On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "Pictures.mdb" which illustrates how to do this.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
G

Guest

Thanks Roger.

David

Roger Carlson said:
You can always find the folder where the database currently is by using
this:
pathname = CurrentProject.Path
Therefore, you can set the path to the your pictures with this:
Me.ImgStock.Picture = pathname & "\" & PictureNameVariable

This way, no matter where the database is, as long as the pictures are in a
subfolder, it will find them.

On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "Pictures.mdb" which illustrates how to do this.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

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

Top