Solved

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

Posted on 2015-02-15
5
47 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

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

744 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

11 Experts available now in Live!

Get 1:1 Help Now