Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Access database corrupted, then backup becomes corrupted

Posted on 2011-09-19
Medium Priority
Last Modified: 2012-08-14
I made a few changed to an Access 2003 database: Added two very simple select queries and added about 20 lines of VBA code to a form. When I reopened the file, I got the following error when Access was opening the database: "Microsoft Access has stopped working." When I clicked "Show Problem Details: It displayed the following:

Problem signature:
  Problem Event Name:      APPCRASH
  Application Name:      MSACCESS.EXE
  Application Version:      14.0.6024.1000
  Application Timestamp:      4d83e4fc
  Fault Module Name:      VBE7.DLL
  Fault Module Version:
  Fault Module Timestamp:      4d430aec
  Exception Code:      c0000005
  Exception Offset:      00023081
  OS Version:      6.1.7600.
  Locale ID:      1033

Additional information about the problem:
  LCID:      1033
  skulcid:      1033

Luckily, I created a backup copy just before I had made the changes. So, after copying my backup, I opened it. Just to be safe, I compacted and repaired the database before continuing. Then I made the same changes and did another compact/repair. I closed the database. When I reopened it, I got the same error message as before. My copy of the original database opens just fine.

By the way, the program uses linked tables to a single backend database.

Perhaps the VBE7.DLL file is corrupted?

I can open other databases just fine--including the previous version of this file. However, I have not done extensive testing of any of the other databases. I am using Access 2010.

Perhaps I should make the changes to the backup, one line of code at a time. Then exit Access and relaunch it. When it will not reopen, perhaps the last bit of code I added is related to the problem.

Any ideas?

Question by:gordonwwaugh
  • 2
  • 2
  • 2
  • +1

Author Comment

ID: 36563282
I did a bit more troubleshooting. Adding the queries was no problem. The problem occurred when I added a button to a form. With this version (with a button), Access crashed when I do anything related to VBA (e.g., clicking buttons on a form). Even opening VBA from my ribbon crashes Access. However, I can run queries without any problem.

And it's only in this file that VBA crashes Access. VBA works fine in my other Access files.
LVL 75

Accepted Solution

DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 36563304
Try this procedure on the suspect db:

A **DeCompile** may help here ...

But first, if you have not already:
Open the VBA Editor and from the menu ...Tools>>References ....
If you see any listed as **Missing: <reference name>, including the asterisks and the word Missing, the
you need to fix that first.

Then, follow this procedure:

0) **Backup your MDB BEFORE running this procedure**
1) Compact and Repair the MDB, as follows:
Hold down the Shift key and open the MDB, then from the menu >>Tools>>Database Utilities>>Compact and Repair ...
Close the mdb after the Compact & Repair.
2) Execute the Decompile (See example syntax below) >> after which, your database will reopen.
3) Close the mdb
4) Open the mdb and do a Compact and Repair (#1 above).
5) Close the mdb.
6) Open the mdb:
    a) Right click over a 'blank' area of the database window (container) and select Visual Basic Editor. A new window will open with the title 'Microsoft Visual Basic' ... followed by then name of your MDB.
    b) From the VBA Editor Menu at the top of the window:
        Note ... after the word Compile ...you will see the name of your 'Project' - just an fyi.

7) Close the mdb
8) Compact and Repair one more time.

*** Executing the DeCompile **EXAMPLE**:
Here is an **example** of the command line syntax  (be SURE to adjust your path and file name accordingly) before executing the decompile:

Run this from Start>>Run, enter the following command line - **all on one line** - it may appear like two lines here in the post:
Also, the double quotes are required.

"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile "C:\Access2003Clients\YourMdbNameHERE.mdb"

For more detail on the Decompile subject ... visit the Master on the subject (and other great stuff) Michael Kaplan:


AND ...
Once you get familiar with the Decompile idea (and ALWAYS make a BACKUP first!) ... you can add both Decompile and Compact/Repair to the Right Click menus in Windows Explorer, which I use multiple times daily:

Getting the Decompile and Compact context menu options

LVL 26

Expert Comment

ID: 36563365
I would rebuild the object you are trying to edit.
Chances are it has gotten brittle.

I regularly destroy OP's samples from here when they were created by A2007+ form wizards and I edit them with A2003.

Create a new form.
Copy all the controls from the old one
Copy all the code from the old one
Copy things like RecordSource, form background pictures etc.

I find it very likely that edited object is the culprit.

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

LVL 61

Expert Comment

ID: 36566252
Curious -

What was the nature of the code and/or other changes you made to the database?

Also,  have you been taking steps to prevent corruption, such as using a split frontend/backend setup? Tips here:

Read the tips, and the discussion comments. The tips overall are sound (with the possible exception of 'compact on close', which I have never had issues with personally but others have found to actually be a source of corruption).

A possible problem with your approach of working with a backup copy of this database is that any objects or data that are corrupted are getting passed on from your backup to whatever copy you are working on.

If it is one particular form giving you this trouble, As Nick suggested you might try creating a new copy of it and copy/pasting the controls from the original onto it.


Author Closing Comment

ID: 36566985
The decompile worked! Thanks!

Actually, it worked on one of my two corrupted versions of the file. In the other version of the file, Access crashed when I selected Compact/Repair within Access.
LVL 26

Expert Comment

ID: 36567662
I have a folder near my dev and production folders called Decompile.
It has a short little text file with
Backup ~ decompile ~ compact ~ compile ~ compact again
Written in it, so I have the instructions, and it has 'preloaded' shortcuts with the right command built in them for each db that may need decompling
I am running x64 Windows so the shortcuts are

"C:\Program Files (x86)\Microsoft Office\OFFICE11\MSACCESS.EXE" "PathToWhateverFileNeedsDecompling" /decompile
The folders on the M:\ drive so PathToWhateverFileNeedsDecompling is "m:\decompile\somefilename.mdb"

I drag and copy in whatever needs decompiling, and double-click.
Then I drag and copy it back out.
Simple and convenient--and it makes the backup immediately since you are not decompling the original, but the copy you've created in the decompile folder.

LVL 75
ID: 36567977
Long live Decompile, DAO and JET!


Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question