sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
rb's Avatar

attaching picture to table


Question posted by: rb (Guest) on January 1st, 2006 04:05 AM
I am making a simple inventory control db. I want to include a picture of
the item in each record. The picture will be from digital camera and in jpg
format. I want to be able to browse and choose the picture as i am inputting
info about each item. It would be best if the picture was imbedded into the
db rather than a link to jpg file.
thanks for any help
ron


1 Answer Posted
Anton's Avatar
Guest - n/a Posts
#2: Re: attaching picture to table

Hi rb,

In my opinion embedding images in a table is BAD; causing massive
bloat. I would (and do):

a) open the file selection dialog
b) have the user select the image file
c) copy the selected file to an image directory in the db directory
d) rename the copied file to the primary key value of the active record

then when you want to refer to the image you can do something like:

If Len(Dir$(CurrentProject.Path & "\Photos\" &
Forms!frm_Main!txt_ProdID & ".jpg")) = 0 Then
Forms!frm_Main!Image56.Picture = CurrentProject.Path & "\None.jpg"
Else
Forms!frm_Main!Image56.Picture = CurrentProject.Path & "\Photos\" &
Forms!frm_Main!txt_ProdID & ".jpg"
End If

Hop this helps :)

 
Not the answer you were looking for? Post your question . . .
196,948 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,948 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors