Solved

Ms Access Compiles without VBA code

Posted on 2014-03-03
6
985 Views
Last Modified: 2014-03-04
Hi Experts

I have an Access Datafile with some VBA forms and code, when I "Make MDE" file with the Datafile it creates the MDE file ok, but when I launch the MDE file it appears that no VBA code has been included with the build.

Is there anything that I might have missed?

I can compile the code via VBA debug menu with no problems.
0
Comment
Question by:MrDavidThorn
  • 2
  • 2
  • 2
6 Comments
 
LVL 23

Expert Comment

by:Eirman
Comment Utility
Is the code working, and not visible?
No code is visible within a MDE file.
0
 

Author Comment

by:MrDavidThorn
Comment Utility
Its not working, I think it may be do with the Signature.
0
 
LVL 23

Expert Comment

by:Eirman
Comment Utility
Try decompiling your MDB file and recompiling as described here ...
http://stackoverflow.com/questions/3266542/how-does-one-decompile-and-recompile-a-database-application

Or here
http://social.msdn.microsoft.com/Forums/office/en-US/72b842b0-86a0-4476-afc3-ae9d5ea740ff/decompile-steps-for-mdb?forum=accessdev

Well described here ....
http://forums.databasejournal.com/showthread.php?34222-Decompiling-VBA-code-in-an-Access-mdb-file

Routine decompiling is almost as important as routine compacting.

(If you are trying to run the MDE file on another PC there could be library issues).
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
More then likely, it's "macro" security that is stopping the DB from executing.  It must be in a trusted location, or the macro security level must be set to low.

If it made a MDE successfully, then I doubt there is a problem with the code.

Jim.
0
 

Author Comment

by:MrDavidThorn
Comment Utility
Im testing with a form that just displays a simple msgbox when the db is loaded, works before the code is published but not in the MDE file.  The code is not digitally signed, but in [Access Options],[Trust center],[Trusted Publishers]  their is a list of valid publishers. Would this have an impact?

This app is a for a global business so they have more than likely got some global setting that is not validating the MDE
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
Comment Utility
The DB will need to be either digitally signed, run from a trusted location, or Access have macro security disabled.

Here's info on security issues:

http://office.microsoft.com/en-us/access-help/get-started-with-access-2007-security-HA010198047.aspx

  including how to digitally sign the DB.  You of course need to be deploying with the packaging wizard.

 On setting a trusted location, here's some info on that:

http://office.microsoft.com/en-us/word-help/create-remove-or-change-a-trusted-location-for-your-files-HA010031999.aspx

 For doing it manually.  Or as part of your deployment, you can create trusted locations.  It's simply adding a entry in the registry, but you cannot do this from the runtime install itself.

 Here's a link to a .EXE package that you can deploy to set an entry along with the registry keys were the path needs to be stored:

http://www.accessribbon.de/en/index.php?Trust_Center:Trusted_Locations

  Changing the macro security level is not a good option.

  Until you do one of the three, any VBA code will not run.

Jim.
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

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

743 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

19 Experts available now in Live!

Get 1:1 Help Now