The database cannot be opened because the VBA project (1 Viewer)

Hello1

Registered User
Joined
May 17, 2015
Messages
218
Im developing the .accdb at my PC which has Office 2007 and Office 2010, Im using Office Access 2007 for this .accdb.

On my PC in this location C:\Program Files (x86)\Common Files\Microsoft Shared\VBA I have VBA6 and VBA7 folders

In Program Files (without x86) I dont have the VBA folder because both versions are 32bit.
On the server PC there is only VBA 7 folder at this location (the .dll is the same version as mine) C:\Program Files (x86)\Common Files\Microsoft Shared\VBA, however, there is also a VBA 7.1 at C:\Program Files\Common Files\microsoft shared\VBA. The server has Office 2010 and 2013, 2010 is being used.

Now could that 7.1 be causing the error? But I dont see a reason to do it so because Im compiling the .accde at my PC and not on the server.
As I remember in the past it worked fine without this error. The error shows up when I right click on a table and select Linking manager.

I tried an older .accdb version of mine which im 99% sure it worked without this error because whenever I put a new version I use the linking manager and check if all the tables are linked correctly but the older version shows the same error (description in attachment).

Edit: I forgot to mention that I made the .accde at my PC and then moved it to the server, I had a .accdb version with the table links from server. The .accde seems to work fine without errors for now at least..
Edit2: I made a typo wrote accde instead accdb, I colored it red
 

Attachments

Last edited:

GinaWhipp

AWF VIP
Joined
Jun 21, 2011
Messages
5,559
Hmm, so a few questions...
1. Does your code compile (Debug > Compile)?
2. What References do you have set? Are any marked MISSING?
3. Which version did you create the ACCDE in?
 

isladogs

CID Moderator
Staff member
Joined
Jan 14, 2017
Messages
12,326
i'm not convinced that having both VBA6 & VBA7 folders is an issue. i have both folders on my tablet which has only ever had Office 2010 installed as well as on a desktop with both Office 2010 & 365.

The error occurs when compiled code gets corrupted. If you still have a usable ACCDB version of it then i suggest the following on a COPY of your database.
1. Decompile your project to remove corrupt compilation code. See http://www.fmsinc.com/microsoftaccess/Performance/Decompile.asp
2. If not already done, tick Require Variable Declaration in the VBE then check each existing code module has Option Explicit as the second line at the top.
3. Next recompile your project using Debug...Compile
4. Compact and repair
If that works , make another backup copy.

Good luck
 

Hello1

Registered User
Joined
May 17, 2015
Messages
218
Hmm, so a few questions...
1. Does your code compile (Debug > Compile)?
2. What References do you have set? Are any marked MISSING?
3. Which version did you create the ACCDE in?
1. Yes
2. All same as on my PC
3. I made it in Access 2007 (have to check the exact version)

After the error there is another message which I forgot to screen, it states that the object Im trying to access is broken (something like that). Today when the server is free I will do a repair of the Office installation and check again.

Also, I made a completely clean database and then linked one table to it and tried to access Linked table manager but got the same error, thats why I think something is wrong with the Office installation.

isladogs I didnt manage to try this, if the above doesnt help today I will try it, tnx.
 

isladogs

CID Moderator
Staff member
Joined
Jan 14, 2017
Messages
12,326
When you copied all items into a new clean database, the likelihood is that any corrupted code will have been transferred across anyway. The only advantage of a fresh database is that any system tables errors will be fixed as the system tables are rebuilt in the new database.

To deal with code corruption, I would therefore still strongly recommend you decompile as well. It only takes a few seconds to do and cannot do any harm.

The other points I made should be done in all databases as a matter of standard practice
 

Hello1

Registered User
Joined
May 17, 2015
Messages
218
You misunderstood me, I didnt transfer anything to the new database. The database is completely empty without any code, just one table and its the default one access makes so I saved it.
 

isladogs

CID Moderator
Staff member
Joined
Jan 14, 2017
Messages
12,326
Sorry. Just read the previous answer again.
With a clean database and just one linked table there will be no vba project.
So it does indeed sound like an issue with Office itself.
However before you reinstall Office, try holding the shift key down as you open the new bare-bones database. Any difference?
Try removing the linked table. Any difference? If yes to the latter, you may have data corruption in the linked table.
 

Hello1

Registered User
Joined
May 17, 2015
Messages
218
The table I linked is from another fresh database I made, also completely empty. I will try the shift key later, thanks.
 

GinaWhipp

AWF VIP
Joined
Jun 21, 2011
Messages
5,559
If none of the above helps then please list the References you have set.
 

isladogs

CID Moderator
Staff member
Joined
Jan 14, 2017
Messages
12,326
Now you've supplied extra info, I doubt the shift key will achieve anything.
Does the message still occur in a database with no linked tables?
Can you also tell us exactly what the second message is or show a screenshot
 

Hello1

Registered User
Joined
May 17, 2015
Messages
218
Hey guys, unfortunately no luck. I did a repair but the error still occurs. I added in the attachment the second message.

Does the message still occur in a database with no linked tables?
I cant access the linked table manager without having at least one linked table, so I cant find that out. The option is grayed out if only tables of the current database are present.

The code is still in VBA, nothing is removed and the .accde I made at my PC seems to work fine because there werent any complains but sooner or later I will need the linked table manager.

If none of the above helps then please list the References you have set.
I attached a screenshoot
 

Attachments

isladogs

CID Moderator
Staff member
Joined
Jan 14, 2017
Messages
12,326
Excellent. It was corruption. Just not the most likely source!
Thanks for posting the links. They may be useful for others in the future
 

GinaWhipp

AWF VIP
Joined
Jun 21, 2011
Messages
5,559
Glad you fixed the problem. I would add this Reference...
Microsoft Visual Basic for Applications Extensibility [vbe6.dll] 5.3
...causes issues such as you describe. Please make a back-up of your database and uncheck, compile.
 

Hello1

Registered User
Joined
May 17, 2015
Messages
218
Today I faced another issue when trying to export a report into Excel, Word or whatever uses the Access export wizard. I tried by removing again the mentioned files above but it didnt fix it. Luckily I have the same Access version 2010 and copied my files (the exporting works fine on my PC, as does the Liking table manager) from the location C:\Program Files (x86)\Microsoft Office\Office14\ACCWIZ to the same location on the PC with the error, and it fixed it. Im attaching the screen of the error.
 

Attachments

gemma-the-husky

Super Moderator
Staff member
Joined
Sep 12, 2006
Messages
13,873
I haven't read the whole thing, but the "bitness" of office might cause a problem.
Declarations of external functions need ptrsafe in 64bit, and not in 32bit - and a database just won't open in the wrong access version. If your 2 setups conflict, it might give you the problem.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom