Link to home
Start Free TrialLog in
Avatar of Derek Brown
Derek BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Too many objects in DB

I am trying to update from Access 2002 to access 13. I can convert without issue but my application is huge and access 2013 will not create an MDE file because there are too many objects in the database. I seem to remember that an access third party produced some useful tools. I thought the company was called Access Everything but I cannot find them.

I am hoping I can find some software that will eliminate many of the redundant queries forms and reports that I have built up over the last 16 years. Any help would be appreciated.
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

You're probably thinking of www.everythingaccess.com.

That said - if you were able to work with this in 2002, you should be able to work with it in later versions (at least as far as number of objects is concerned).

Have you tried to first create a new, blank database and import everything into that new database? This often rids your db container of old junk, and can significantly decrease size.
If native procedure doesn't work i wouldn't rely on a 3rd party solution to create something that you ought to have it done just by picking a selection...
I am under the impression that you have some other kind of issue (probably corruption or some unsupported ActiveX/Dll)...then solution is either to follow Jim's advise or try to Compact&Repair, Decompile,Compile and again Compact&Repair...somewhere at somepoint you should get the real problem
Does the VBA portion of your database Compile?
You cannot create an MDE if you have any compile errors.
1. Adding to Joe's comment, your 2013 VB Project environment might require variable declarations (Option Explicit) and the 2002 environment did not.  Check to see whether you can Debug | Compile your code.

2. Enable viewing system and hidden objects in your database.  Look at the tables and queries.  What do you see?
This error is not really caused by too many objects, but rather an error in the VBA code.

As another option to what Scott said (creating a fresh DB), make a backup, then do a /Decompile:

https://www.experts-exchange.com/Database/MS_Access/A_2043-Decompile-What-it-is-what-it-does-and-how-to-use-it.html ) or import everything in a new DB container (only source code is copied when you do this).

After that, open the DB and make sure it compiles with no errors.   Then try creating a MDE.  Do this right after opening the DB.  

Jim.
Avatar of Derek Brown

ASKER

Thanks All

I have done nearly all of that but may have not done so in the correct order. I will give it a go now.
OK Done that and I get "Access cannot create MDE File" and details:

This error is usually associated with compiling a large database into an MDE file.  Because of the method used to compile the database, a considerable number of TableID references are created for each table.  The Access database engine can only create a maximum of 2048 open TableIDs at one time.  Exporting a database as an MDE potentially can exceed this limit if the database has a large number of objects (table, macro, form, report, etc).
There is no accurate method to estimate the number of TableIDs the Access database engine uses during the process of compiling a database as an MDE.  However, each VBA module and each form uses one TableID, as a result, if the database has 500 forms, and each form's HasModule property is set to Yes, as many as 1,000 TableIDs are used.
But someone is correct here because I tried it again after deleting all of the tables still get error.

Also I seem to have a duplicate of everything from the original.

Need to start again and see if I get same problem
But ... did you try to Compile your VBA code ?
VBA Editor >> Debug >> Compile
<< if the database has 500 forms, and each form's HasModule property is set to Yes, as many as 1,000 TableIDs are used.>>

  The question is, how many objects do you have?   and does your app compile?

  99% of the time, it's a VBA project that won't compile that is the cause of this, not the table ID's.  While a lack of table ID's can cause this, it's rare.

  The only other thing you can do at this point is run through the forms and make sure the "Has Module" property is set correctly.

  But as a fast test, I would suggest creating a new DB container, import every but forms, reports, and VBA code, and then try making a MDE.   If it works, then try bringing in the VBA code.

 If that works, then bring in the report, then the forms, etc  making sure it compiles first each time.

Jim.
Thanks Jim

Something strange. I compacted and repaired a couple of time on the MDB and suddenly got a file 2000KB smaller. I then did an mde with my old access 2002 and got an mde 1800KB larger???

I will try your suggestion now,
Please try to Compile the VBA code ...
Be sure you make a copy of your database before you try the compile and such. If you have troubles, the compile option could cause irreversible damage.

You might also try to Decompile your database. To do that, create a shortcut with this as the Target:

"full path to msaccess.exe" "full path to your database" /decompile

Run that shortcut, the do the Compile as Joe suggested, then the Compact as Jim suggested.
Sorry should have pointed out that I had compact and repaired 3 times then compiled then imported all content into new DB and compiled the code. So All that works. I just imported all into 2013 and got an MDE immediately. Further checking however shows that 2 forms and 2 queries were not created in the MDE version.. So I guess that this is where the problems are
Because I can no longer use DAO 3.6 (not compatable with 13) I get error when compiling in 2013. The code breaks at

Recordset.Edit
Open the VBA References.
Are any shown as
**MISSING <SomeReferenceName>

?
Hi MX there are no missing references.
SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
error is "method or data member not found". There is no error number

When I look in 2013 code window there are references for Microsoft Office 15 Access Database Engine Objects
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you all. Seems problems are as you say with code. Some forms will not carry over to 2013 so I must have issues with those forms. Also 2 queries did not import. still working on it. My thanks again to all