Results 1 to 2 of 2
  1. #1
    zkrucz is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2016
    Posts
    103

    Removing images from Access DB via Update Query?

    I have a DB with images loaded in attachment fields (up to 10 per record, and thousands of records). I need to create space in the DB and I would like to remove many images which are no longer useful using something similar to the update query. However, when I tried it using an update query, I got an error stating that the fields with multiple values (attachement: data, field name, type) cannot be updated or deleted.



    Does anyone have any experience on how it can be done via another method?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    To programmatically extract images and save to folder location or to delete specific images requires VBA manipulating recordset objects. Review https://sourcedaddy.com/ms-access/wo...nt-fields.html

    Can open a query that expands the attachment field so each attachment is displayed on its own row then manually delete records. However, trying this with a DELETE action SQL fails because of the multi-value nature of attachment field.

    Advise to not store attachments in table, just store path to file in a text field. If each record can have multiple images then use a related dependent table so each path is a record. Even if using attachment field, 1 attachment per record would have made this purge much easier. Then entire record could be deleted.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-11-2018, 11:44 AM
  2. Replies: 1
    Last Post: 10-27-2016, 12:14 PM
  3. Removing images from the database
    By ksammie01 in forum Access
    Replies: 4
    Last Post: 01-15-2013, 12:50 AM
  4. Removing access features
    By GraemeG in forum Programming
    Replies: 1
    Last Post: 03-10-2011, 11:12 AM
  5. Replies: 17
    Last Post: 08-26-2009, 11:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums