Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove images stored in access (.accdb)?

I'm trying to keep access database size to a minimum and need to remove several large images that previously were used but now aren't needed. My understanding is access files (.accdb) store images inside the database. Do you know if it's possible to remove it and how? TIA

clarification & solution: I had several different forms with different background images, however at this point I have figured it out (for Access 2013) -> under Form Design Tools -> Design -> Insert Image, then right click on the image you need to remove and then click on Delete. Done.

like image 254
Rang Avatar asked Feb 07 '23 10:02

Rang


2 Answers

Just to make it easier for anyone else looking for this answer, here is a screen shot of what this looks like in Microsoft Access 2010:

enter image description here

like image 130
AdamsTips Avatar answered Feb 16 '23 23:02

AdamsTips


If you want to completely remove all shared pictures in the database, or ones whose name matches a certain pattern you can do something like this:

Sub PurgeSharedImages(Optional strPattern As String = "*")
  Dim i As Integer

  For i = CurrentProject.Resources.Count - 1 To 0 Step -1
    If CurrentProject.Resources(i).Type = 1 And CurrentProject.Resources(i).Name Like strPattern Then 
      CurrentProject.Resources(i).Delete
    End If
  Next i
End Sub
like image 31
Mike Lyons Avatar answered Feb 16 '23 23:02

Mike Lyons