Solved

Access database corrupted, then backup becomes corrupted

Posted on 2011-09-19
7
843 Views
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:      7.0.16.19
  Fault Module Timestamp:      4d430aec
  Exception Code:      c0000005
  Exception Offset:      00023081
  OS Version:      6.1.7600.2.0.0.256.4
  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?

0
Comment
Question by:gordonwwaugh
  • 2
  • 2
  • 2
  • +1
7 Comments
 

Author Comment

by:gordonwwaugh
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.
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 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:
       >>Debug>>Compile
        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:

http://www.trigeminal.com/usenet/usenet004.asp?1033

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
http://access.mvps.org/access/modules/mdl0039.htm

mx
0
 
LVL 26

Expert Comment

by:Nick67
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
Paste
Copy all the code from the old one
Paste.
Copy things like RecordSource, form background pictures etc.

I find it very likely that edited object is the culprit.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 61

Expert Comment

by:mbizup
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:
http://www.techrepublic.com/article/get-it-done-top-10-ways-to-prevent-access-database-corruption/1060083

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.



0
 

Author Closing Comment

by:gordonwwaugh
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.
0
 
LVL 26

Expert Comment

by:Nick67
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.

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

mx
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now