[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

Are attachments orphaned if software crashes during the add function

I have a database I am developing in MS-Access 2007.  The size is not an issue, I have read the tip on slow response from a database with multiple forms.  I am attaching several text files to the database in an "attachment" field type.  After debugging the code I came to the realization that since I was crashing out of the application are these attachments being orphaned?  If they are orphaned will the "Compact and Rebair Database" function get rid of the orphaned records.  I would assume that when a record is deleted from the database, the appropriate "attachment" field information is also deleted.  But since I am crashing out of the database, I am not properly closing the file.    Does anyone have any thoughts on this?  
  • 2
1 Solution
Dale FyeCommented:
This won't be much help, but I recommend against adding attachments to the Access database.  It is far easier to manage storing the attachments to a file server somewhere, and then recording the filepath and name in the database.

Access databases are relatively limited in their size, and attachments will quickly gobble up the available space.
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
The Attachment datatype has alleviated some of those issues fyed mentions, however I also concur - unless you have a compelling need to store those attachments in the database, then just store the path and use that to work with the item.

One example where you might use the Attachment field would be if you need to include photos of products for a travelling salesman. It would be dificult to sync up the photos on a file system, and in that case the Attachment datatype might be a good fit.
Dale FyeCommented:
<The Attachment datatype has alleviated some of those issues fyed mentions>

Scott, are you implying that the attachments are not included in the total database size limits?

I'll add a third chime to saying that Attachment data types are evil.
Create a table with an autonumber primary key, a foreign key to the existing table and a text field to store a path.
Then save out your file to a folder, and put a record in the new table.

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now