Solved

Ms Access Compiles without VBA code

Posted on 2014-03-03
6
988 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
ID: 39900589
Is the code working, and not visible?
No code is visible within a MDE file.
0
 

Author Comment

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

Expert Comment

by:Eirman
ID: 39900625
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 57
ID: 39900689
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
ID: 39900721
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
ID: 39900808
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

930 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

12 Experts available now in Live!

Get 1:1 Help Now