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


Database cannot be opened

Posted on 2012-08-12
Medium Priority
Last Modified: 2012-08-18
When opening a DB on an XP box I get an erro message stating. "database cannot be opened because the VB project cannnot be read.    

I am able to open the DB fine on other XP Boxes, just not this one in particular
Question by:seamus9909
LVL 13

Expert Comment

ID: 38285444
Do you have Visual Basic redist installed? .net framework? If yes, reinstall it.
LVL 75
ID: 38285584
This is generally not a good sign.

You can try the procedure first ... on a db - on a system where it is working, then try that db on the suspect system.  Or do the procedure on your 'master' copy on a known good system, then try opening on suspect system.

The good news is, it opens on other systems.

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

    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
http://access.mvps.org/access/modules/mdl0039.htm (note:link my be temporarily broken - if so, let me know and I can upload).

LVL 85

Accepted Solution

Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 38287204
Since it works on one box but not the other, I'd suspect you have either (a) a bad copy of the database on that machine or (b) troubles with theinstallation of Office/Access or Windows on that machine.

To check the bad copy, just do as mx said and load a known good copy on the machine. I'm sure you've already tried that, but just in case ...

As far as bad installs - be sure that your service packs and updates are all in place on the machine. Don't trust automated updating - head over to the Windows Update site and make sure all is well.

If that doesn't work, you might try a repair install of Office. Rerun the installation, and choose Repair at the menu.

If that doesn't work, then you may need to uninstall/reinstall Office.

A last suggestion would be to use a different user when working on that machine, to test the User profile. Those can become corrupted and cause very odd issues. If you can log onto the machine as a different user, and the database runs okay under that login, then you'll have to delete that user profile and recreate it (or just use a different one).

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

834 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