Link to home
Start Free TrialLog in
Avatar of Massimo Scola
Massimo ScolaFlag for Switzerland

asked on

External images are saved in MsSysResources table - How to avoid it?

I am developing an employee database which displays the employee's Picture when his/her record is selected.
The Picture is displayed using the following procedure:

Private Sub Form_Current()
  On Error GoTo ErrorPicture
    imgPicture.Picture = CurrentProject.Path & "\fotos\" & emp_Picture
    On Error GoTo 0
    Exit Sub
    
ErrorPicture:
    On Error Resume Next
    imgPicture.Picture = CurrentProject.Path & "\fotos\_Person.png"
End Sub

Open in new window


The Problem is that the image is added to the hidden MsSysResources table.
With almost 300 Pictures, the database has grown from 5 MB to 200 MB in size.
Is there a way to not store the images in this table?

Thanks for your feedback

Massimo
Avatar of Daniel Pineault
Daniel Pineault

See Adding Attachments to an Access Database for everything you need to know on the subject.
ASKER CERTIFIED SOLUTION
Avatar of Anders Ebro (Microsoft MVP)
Anders Ebro (Microsoft MVP)
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can use the simple and proven method as described in my article:

Show pictures directly from URLs in Access forms and reports

A full demo is included.
Just to follow-up regarding switching the Picture Type to Embedded, although not stored in the MsSysResources  table, it is still being embedded within the database, so you still get bloating and for systems with lots of such images it remains a problem (you can fast approach the 2GB file size limit).  Storing the paths/filenames as text remains the proper solution for such cases.  Personally, I only embedded things like button images and the likes (GUI components that I know are 100% static), but all content relating to records are simply stored as plain text.
Yes, you would want to link images so they don't get stored anywhere in the DB.

Jim.
Avatar of Massimo Scola

ASKER

That worked - thanks a lot!