Error #5 after compact and repairing (1 Viewer)

biofaku

Member
Local time
Today, 08:39
Joined
May 15, 2020
Messages
66
I don't know, I think if that was a solution, the code should work on a different pc, right? Or maybe because the references are messed up on this PC then are messed on any other PC?

By the way, the error just prompted without clicking compact & repair... But I had a good amount of crashes on the client due to my poor programming skill before that, so that may have triggered it.

So anyway, gonna try reinstalling office, but I don't have many hopes with that.

Thanks for your help everyone!
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 11:39
Joined
Sep 12, 2006
Messages
15,614
Out of interest, does your database compile without error? I would be inclined to check that first.
 

biofaku

Member
Local time
Today, 08:39
Joined
May 15, 2020
Messages
66
Out of interest, does your database compile without error? I would be inclined to check that first.
Yes, I have compiled it, but it doesn't show any error at all right now. Nevertheless, if I click compact and repair, it messes all.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:39
Joined
Feb 28, 2001
Messages
27,001
Hello biofaku,

The initial assumption is that the database is corrupt, which is partially true. We do resort to creating a new database and importing their objects into it which is time-consuming but solves the problem, but there's a better alternative to check first.

Microsoft Access offers a way to fix the VBA compiled state with the /decompile command-line option.

To decompile your database, follow these steps:
  • From Windows Explorer, locate where your Access program is installed by searching for MSACCESS.EXE. If you have multiple versions of Access installed on your machine, you need to identify the path to the Access version you want.
  • From the Windows, Start, Run command line, type: msaccess.exe /decompile where msaccess.exe includes the complete path.
  • C:\Program Files (x86)\Microsoft Office\root\Office16\MSACCESS.EXE /decompile
  • From Access open the database you want to decompile (with trusted authority for Access 2003 or later)
  • Open up any module. Compile it via Debug, Compile, then File, Save.
  • Go back to the database and Compact it. The location of the Compact command varies by Access version.
The database size should be reduced and the strange errors related to the VBA code should be gone.

Best Regards,

Cheryl

Cheryl, if you look at post #2 of this thread, you would see that /Decompile was in fact suggested. Also note that you replied to a thread for which the last post was over a year ago. All of us want to help and appreciate others, even new members, offering constructive comments. However, to prevent you from wasting effort on an abandoned thread, it might be helpful if next time you responded, look at the posting date of the most recent reply. And please don't take this as a knock. It's just that you are new to the forum and maybe haven't noticed the posting dates yet.
 

Users who are viewing this thread

Top Bottom