1

I have a database with tables that are linked to a different database in a network drive. (The other database is on a different machine, and a network drive on my machine is mapped to it.)

While I was running some VBA code the connection to the network drive was broken, and I got an error message. When I tried accessing any local tables in my database, or when I tried closing Access I got error messages. I closed access through the task manager, and now when I open it I get the following message:

The VBA modules in this database appear to have been saved with errors. Access can recover the modules, but you should backup the database first...

I backed up and then clicked OK, but the modules have been entirely wiped out. In the backup I cannot access the modules, I just get that message again.

Please help! Sadly I do not have a backup from before, and I need the modules. Is there a way to recover at least the modules? Even in text file?

I tried importing the modules into a different database, but I get the same error message.

EDIT: When I try to recover I get the following message:

Cannot open database ''. It may not be a database your application recognizes, or your file may be corrupt.

What does this mean? It seems like Access is trying to access an empty string.

MJH
  • 839
  • 1
  • 17
  • 37

2 Answers2

1

oh... That one hurts! I've been in a similar situation but not exactly the same way. The good news is that you can almost always recover from these situations. Try this: Create a new blank database and import all tables, queries, forms, reports, macros, and modules into the new database...

If that's not possible you may have to decompile the database. See: https://www.fmsinc.com/microsoftaccess/errors/Bad_DLL_Calling_Convention.asp

Anthony Griggs
  • 1,469
  • 2
  • 17
  • 39
  • I'm somewhat less optimistic for the import, but it's worth a try. For a full decompile run, see: [Decompile](http://stackoverflow.com/a/3268188/3820271) @MJH – Andre Jun 16 '16 at 06:21
  • I tried your link for decompiling, but I typed this: **C:\Program Files\Microsoft Office 15\root\office15\msaccess.exe/decompile** in ommand prompt, and I got **'C:\Program' is not recognized as an internal or external command, operable program or batch file.** – MJH Jun 16 '16 at 06:48
  • I tried decompile but I get the same error as the first error in my question. – MJH Jun 16 '16 at 10:34
  • Does the db normally open to a Form as default? If so try holding the Shift key down with the decompile. – random_answer_guy Jun 16 '16 at 18:35
  • @MJH: Re. "'C:\Program' is not recognized as an internal or external command, operable program or batch file": That's probably because you didn't enclose the entire File Path in double quotes ("). In Window Command Prompt, any Folder Path or File Path that contains a space(s) has to be enclosed in double quotes. Also, I believe you need to have at least one space between "msaccess.exe" and "/decompile" (i.e. between a command and its parameter(s), if any). – Tom Feb 11 '21 at 18:33
1

Do double-check the path. Most likely it is:

"C:\Program Files (x86)\Microsoft Office\root\Office16\MSACCESS.EXE"

and a space is missing:

"C:\Program Files (x86)\Microsoft Office\root\Office16\MSACCESS.EXE" /decompile

That's for A2016. It is Office15 for A2013.

Gustav
  • 53,498
  • 7
  • 29
  • 55