Solved

Compile error in hidden module.

Posted on 2001-09-17
7
1,139 Views
Last Modified: 2012-08-13
Hi, I have a user who within Access 97 (SR-2) is trying to convert a database into MDE. When doing so it is reporting "Compile error in hidden module".  I've asked him to try a basic DB from scratch and it works fine.  He's exported elements from his database into another one and works fine upto a particular form.  When using the Database it works fine without reporting this error.  He has no hidden modules (as far as he's concerned and hasnt created one.  Any ideas?  Ta V much in advance,
Martin.
0
Comment
Question by:mrbud
  • 3
  • 2
  • 2
7 Comments
 
LVL 6

Expert Comment

by:cjswimmer
Comment Utility
check out Dev Ashish's comments on this problem at:

http://www.mvps.org/access/bugs/bugs0020.htm
0
 
LVL 6

Accepted Solution

by:
cjswimmer earned 135 total points
Comment Utility
here is the text from that article:

---Originally Posted by Dev Ashish---
Bugs: Compile Error in Hidden Module
    This strange problem seems to have different origins and multiple
solutions.  Some of the cases where I've seen (not personally) this error message
come up:
only on one machine with, but not on another, when issuing a "Compile and
      Save All Modules"
only on one machine with, but not on another, when opening a particular form, while a
      recompile works.
when making MDE files from the UI (most common)
only under runtime environment (not on development machine) or using /runtime option
      (second most common)
in Autoexec macro on a Access 2 -> 97 database
in replicated databases using /runtime option.
    The complete message is:
A protected module can't be displayed. This error has the following cause
  and solution:
There is a compilation error in the code of the specified module, but it
  can't be displayed because the project is protected. Unprotect the project, and then run
  the code again to view the error.
    There have been several alternatives suggested, all of them have
worked in one or more cases.  I can only suggest going through each item suggested
here till one of them fixes the problem.

If you have a subroutine or function named the same as a module, rename one of them and
    try again.
Decompile the database, and then import all
    the objects into a new database.
If the database is a converted Access 97 from version 2.0, uncheck DAO 2.5/3.5
    Compatibility Library and select DAO 3.5x Library instead.
      Recompile the database.
In few cases, this was caused by Missing
    References.
If you're using DAO methods such as CreateWorkspace, OpenDatabase,
    CommitTrans etc., for example,  DBEngine.CreateWorkspace,
    DBEngine.OpenDatabase, Workspaces(0).CommitTrans.
0
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
It's probably references. Open a module in design view, click tools/references. Note if any are listed as "Missing" or "Broken".  If so, you'll need to figure out why.

If not, uncheck one reference (note which).  Close the MDB and Access.  Re-open and recheck the same reference.  Now do a compile all.  You should not get any errors.

Then attempt conversion to a MDE again.

Jim.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:mrbud
Comment Utility
Right, I think I've resolved the problem however he needs to do some work.  I'm sorry 'Guys', your suggestions didnt come up with anything(Correct me if i'm wrong).  
What Jim's suggestion did however was to point me to compiling within the module itself which guided me to a 'fix' (I hope, fingers crossed).
I remembered somewhere along the line, when buttons, etc are removed from within a form, the coding is sometimes left behind.  So what is hopefully happening here is, when it tries to compile the code it is pointing to missing objects, such as buttons, fields, etc. (hence, "hidden"!).
So, when he did a compile module, it said variable not defined.  
So this is why it worked without actually compiling the modules, just using the database & why it fails when having to compile the module to convert a MDE.
Sorry to waffle.  Any suggestions who to give the points to or should I keep them... let me know,, i'm reasonable.
I await his call back. (He's going to have to trudge through his code now to find the missing objects!)

Martin.
0
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
CJ was closest overall.  The whole issues revolves around the fact that the MDB wasn't in a compiled state to start and when converted to MDE, had errors in it.

For future reference, this is the #1 mistake made when creating MDE's.  Always make sure the code can compile before trying to create a MDE.  Do this even if it's been OK before and you'll avoid a lot of problems.

Jim.
0
 

Author Comment

by:mrbud
Comment Utility
Ok, A true Gent Jim for suggesting CJ gets the points.  A worthwhile link as well.  Thanks a lot,
Martin
0
 
LVL 6

Expert Comment

by:cjswimmer
Comment Utility
Thanks JDettman, very kind of you.  Thank you too mrbud, I'm glad you're problem is resolved.  
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now