A family of Microsoft relational database management systems designed for ease of use.
Because attachments work in a new test database, the Access attachment feature itself is working and the problem is likely specific to the current database file.
Try this path:
- Make a backup of the database first. A repair can truncate damaged table data, so keep a copy before more troubleshooting.
- Make sure the database is not in use by anything else. Compact and repair requires exclusive access.
- Run Compact and Repair again using the database-not-open method:
- Start Access
- Open Blank Database
- Select File > Close
- Select Database Tools > Compact and Repair Database
- Browse to the problem database and open it Access creates a repaired copy in the same location.
- If Access prompts that the file is corrupted, select Yes to let Access repair it. If repair is only partial, check the MSysCompactErrors system table to see which objects could not be repaired.
- If the database is shared over a network or used by multiple users directly, treat corruption as a likely cause. Microsoft notes a small risk of corruption for shared database files, and the risk increases over time.
- If the file remains unstable after repair, restore the most recent good backup. Corruption can leave forms, VBA, or data objects damaged even after repair.
- For prevention, consider splitting the database so data is kept in a separate file users do not access directly.
Relevant detail for this case: Access stores attachments in native file formats and uses system tables behind the scenes to normalize attachment data. Since only the existing database crashes when working with attachments, damage in that database or its related objects is the most likely explanation supported here.
Also check whether Access is staying open in the background and leaving the database locked. A known Microsoft 365 issue in Version 2201 (Build 14827.20158) caused Access not to close properly, left the lockfile active, and could block compact/repair. That issue was fixed in Version 2201 (Build 14827.20192).