Solved

The database cannot be opened because the VBA project contained in it cannot be read

Posted on 2015-02-15
5
67 Views
Last Modified: 2016-05-22
See the picture.   I get the following error when I open my database.   We can click through it and continue, but it is problematic in that it creates support calls.   Any suggestions?
Capture.JPG
0
Comment
Question by:Gary Fuqua, CISSP
5 Comments
 
LVL 3

Accepted Solution

by:
Leo Alexander earned 168 total points
ID: 40611684
Something became corrupted in that database. You can shift+open the database to get in and do a repair and compact, or if that does not work, create a new database and import everything in from this (corrupted version) to the new one that you just created. I would recommend splitting the database to have tables separate from the forms and vba. Also, create .mde/accde versions that you distribute as they are less likely to become corrupted/manipulated.
0
 
LVL 49

Assisted Solution

by:Gustav Brock
Gustav Brock earned 166 total points
ID: 40611758
If you wish to have your code, I have found no way to get around this other than reverting to a backup.

To me it has happened only when working for a longer time with a frontend off a network drive, thus I always use a copy on a local drive when making design changes except for very simple changes.

/gustav
0
 
LVL 1

Assisted Solution

by:itprojks99
itprojks99 earned 166 total points
ID: 40612197
smarturtle and Gustav are both correct.  It looks like the database is corrupted, and you should fix it soon before it doesn't open at all.  If your data tables are in the same database as your forms/reports, etc. then restoring from a backup will obviously lose any more recent data.   This is why it is a good idea to keep the data tables in a separate "back-end" database, and link to them from your front-end application database.  
If you can't restore from a backup copy that doesn't have this error, then here are the steps you can take to try to recover and repair the database, in increasing order of effort:

1)  Compact and Repair:  Hold the shift key down while opening the database - this should (hopefully) give you access to the Access menu and navigation pane.  Open the Database Tools menu, and click "Compact and Repair".  However, based on your error message, this probably won't do the trick.

2) Decompile / Recompile:  
2.1) Hold the shift key down, while opening the database with a shortcut to the database something like this: "{Insert path to your MS Access version .exe file" "{Insert path to database file here}" /decompile
2.2)  Press Shift-11 to get to the VBA window,  Click on the "Debug" menu, then Compile.  When it is done, click on the "Save" icon in the VBA window.
2.3) Go back to the Access window, and select "Database Tools" menu, and click "Compact and Repair".

3) Create a New Database and Import all the objects to the new database.  Then repeat step 2).
If you undertake this, you may have to import not only all the objects (queries, forms, reports, macros, modules), but also any custom menus, relationships, etc. in the options for importing.  This is probably the most time consuming option but is sometimes the only hope of recovery.

Hope this helps!
0
 
LVL 3

Author Comment

by:Gary Fuqua, CISSP
ID: 40673475
Thanks Guys.   Will try these this week.  Sorry for the delay.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In-place Upgrading Dirsync to Azure AD Connect
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

820 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