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

This morning I got this error

Error accessing file. Network connection may be lost

no matter what i did in any form. So I opened an empty database and imported everything. Some error occurred, but he said the import was successful. I was able to open the form again. Then I returned the old copy, and then I got this error when I try to open the database

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

Even the backup I made before the first error says that.

and I tried to import again, and I got an error while importing it.

Now I'm starting to get nervous, plz tell me how to fix it.

Thank you

+4
source share
2 answers

You can try to decompile when Access complains that it cannot read the VBA project code. See Two answers to this SO question for detailed instructions: HOW to decompile and recompile .

If decompiling is not possible to restore the application in good working order, the fastest solution is likely to return to your last good backup.

If you want to make additional efforts to restore module changes since the last backup, check if you can all access the source code of the module. If the source code is readable, you can use the undocumented SaveAsText method to output the code to a text file:

 Application.SaveAsText acModule, "Module1", "C:\SomeFolder\Module1.txt" 

Then then load it into a new db file using the LoadFromText method.

 Application.LoadFromText acModule, "Module1", "C:\SomeFolder\Module1.txt" 
+5
source

For those who have this problem, here is the update. This problem occurs when .accde is compiled into an Access version that is newer than the vulnerable computer version. It turns out that some machines were updated with the Windows update, and some did not. After installing all Office installations to the same version number, installing Service Pack 2 (SP2), and then updating February 2016, the executable file now runs on all my machines.

Here is a link to SP2 (make sure you have downloaded the file you need.) Https://www.microsoft.com/en-us/download/details.aspx?id=39667

Here's the February 2016 update: https://support.microsoft.com/en-us/kb/3114750

NTN, Patrick

0
source

Source: https://habr.com/ru/post/1438698/


All Articles