Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to recover code that is deleted from modules? Please Help!

Status
Not open for further replies.

smsmail

Programmer
Aug 11, 2010
105
US
When trying to access my database(code, forms, functions, etc).
I received the following message of which I mistakenly clicked the "OK" button. My code is removed. Is there anyway I can recover my code.

Message:

The database cannot be opened because the VBA project contained in it cannot be read. The database can be opened only if the VBA project is first deleted. Deleting the VBA project removes all code from modules, forms and reports. You should back up your database before attempting to open the database and delete the VBA project.
To create a backup copy, click Cancel an then make a backup copy of your database. To open the database and delete the VBA project without creating a backup copy, click OK.

Does Access automatically backup database
 
Sounds like some data corruption occurred. To my knowledge, the only way is through backups/recovery.

If you have a backup database anywhere, you could copy the missing pieces from there. That's what I had to do with 2 or 3 databases about a month ago - scary for sure.

If you don't have a backup of the database you know of, you could try data recovery, and see if whatever program you use finds any previously deleted copies of the database in question, and restore that/those.

Also, did you (or a user) recently upgrade to Access 2010 from 2003 or 2007? That seemed to be the problem with ours - one user was upgraded to 2010 from 2007, and she didn't click the "allow content" options correctly, so things didn't run right. Then she closed the databases, reopened, and got the messages you're talking about. I had to piece together the bits from a couple of different backups.

If you don't know of manual backups, your company may also have a backup policy, assuming it's on a network share, not on a local drive.

Even if it's not a backup, think of anywhere else you might possibly have a copy of the database - possibly in a Zipped archive within an email? in a temp folder somewhere perhaps? Anything possible..

One program that sometimes works, and it's free, and there's no installation - you just run it is called Restoration - however, I will say the results haven't been as good the past few times I've used it... it's pretty old, and I'm not sure it's been updated in some time. Here's a link to it:

At least I think that's it. I don't think I can get to it at work, b/c of the current proxy settings.
 
Thanks Kiv1611 for your assistance. I will try the restoration program. I
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top