Connecting Tech Pros Worldwide Help | Site Map

attaching picture to table

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 1st, 2006, 03:05 AM
rb
Guest
 
Posts: n/a
Default attaching picture to table

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



  #2  
Old January 1st, 2006, 09:55 PM
Anton
Guest
 
Posts: n/a
Default 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 :)

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

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 220,662 network members.