Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do You Store Images In Access? 2

Status
Not open for further replies.

pwel

Programmer
Aug 18, 1999
79
GB
Can you store images in an Access DB, if so, how do you do it? can you store the physical image in the DB or do you store the path to the image?<br><br>Any help will be much appreciated.<br><br>Paul W.
 
You can create a field with a datatype of Object (or OLE Object), which can store the image.&nbsp;&nbsp;You might be able to store the path in a field with datatype of hyperlink.<br><br>Would either of these work for you? <p>Kathryn<br><a href=mailto: > </a><br><a href= > </a><br>
 
You can create an OLE field and either link it (image remains in original state) or embed it (image contained in your database).&nbsp;&nbsp;Your choice.
 
Put it in your forms On_current event.<br>--------------------------<br>Private Sub Form_Current()<br>&nbsp;&nbsp;&nbsp;&nbsp;If Me![ID] &lt;&gt; 0 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Me!Image14.Picture = &quot;p:\ViewPhotos\Photos\&quot; & Me![ID] & &quot;.jpg&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Label20.Caption = &quot;File: &quot; & &quot; p:\ViewPhotos\Photos\&quot; & Me![ID] & &quot;.jpg&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>End Sub<br>---------------------------<br>Add an &quot;Image&quot; control to the form not a bound box.<br><br>This also keeps your database from getting real huge because the files are still on your hard drive and loaded as needed instead of being embedded in the .mdb. <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Thanks people!!!!!!!!!!!!!!!!!!!!!!!!!!
 
Please note that, although you can embed images, you may hit the Access file size limit. I had to move to SQL Server after 300 images.
 
Another benefit to storing a link to the file instead of the actual file, is that sometimes you want to change the image. A new company logo, or a picture of that employee from the company picnic. All you do is copy the image to the location that you &quot;mapped&quot;.
 
Is there really a size limit to an Access database (file)? If so, can anyone point me towards this information?

Much appreciated,
Emilio Ramirez
 
And Can you store images in an Access DB from VB???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top