UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Closed TopicStart new topic
> How Do I Create An Mde, Ade, Or Accde File?, Any Version    
 
   
niesz
post May 20 2007, 06:51 AM
Post#1


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((°>


.MDE!? What's an .MDE?
An .MDE is a compiled .MDB with all editable source code removed. Even though this article deals with .MDB/.MDE conversion, the same principles apply to Access Data Projects (.ADP/.ADE) and Access 2007 File Format (.ACCDB/.ACCDE).
Q: Why would you want to compile an .MDB?
A: Probably the most popular reason is to protect your VBA code. You worked hard at creating it, why not protect it? When a .MDB is compiled, all of the VBA code behind any form, report, or in a module becomes inaccessible, unchangeable. Not only the code itself, but even the design of forms and reports. This can be a very good thing, especially if you want to closely control all modifications to your database or if you are marketing it to the public.
Another benefit that you get from making an .MDE is that your application will be smaller, consuming less memory, and will therefore be more efficient.
Q: Are there any drawbacks to creating an .MDE?
A: In order to create an .MDE, you code has to be 100% syntactically correct. What does that mean? It means you'll need to clean up after yourself if you've left any code "hanging around" where it shouldn't be during development. We'll talk about how to find these types of errors later.
Error handling has to be employed through the entire application. If an error occurs, you can no longer be taken to Debug mode in VBA to fix it. Therefore, thorough testing should be done to provide the user with customized messages to specifically identify the problem.
You lose the ability to programmatically switch to design view of a form or report, modify it, and switch back. While most applications have no need to do this, if you employ this technique you will have to find an alternative method to accomplish your goals.
HAs a developer, all of the above things are a good practice to get into regardless of whether you're making an .MDE or not.
Q: How do I create an .MDE file?
A: Choose Tools>>Database Utilities>>Make MDE File... Browse to the folder where you want the MDE to be created. Click Save.
Q: I cannot create an .MDE file from my .MDB.
Q: The 'Make MDE File…' option is grayed out.
Q: When I choose the 'Make MDE File…' option, nothing happens or an error occurs.
A: Access can only create an .MDE file when the database version is the same as the version of Access you are using. (Ex. Access 2003 cannot create an .MDE when the database format is 2000) Convert the .MDB into your version of Access and create the .MDE.
Let's take all scenario's starting with ACC97.
CODE
MDE creation can only occur when the version of the Access is the same as the file format of the MDB. *
MDE File Format:        Version of Access needed to create MDE:
                        ACC97      ACC2000     ACC2002     ACC2003     ACC2007
ACC97                     X
ACC2000                               X
ACC2002/2003                                      X           X           X
ACC2007 (.ACCDE) **                                                       X
MDB file format:        Can be opened/read by Access Version:
                        ACC97      ACC2000     ACC2002     ACC2003     ACC2007
ACC97                     X           X           X           X           X
ACC2000                               X           X           X           X
ACC2002/2003                                      X           X           X
ACC2007 (.ACCDB)                                                          X
MDE's created with:     Can be opened/read by Access version: (RunTime included ***)
                        ACC97      ACC2000     ACC2002     ACC2003     ACC2007
ACC97                     X           X           X           X           X
ACC2000                               X           X           X           X
ACC2002                                           X           X           X
ACC2003                                                       X           X
ACC2007                                                                   X
* Access 2007 has two native formats (ACC2002/2003 and ACC2007) so it can create .MDE's for both.
** Access 2007 .ACCDB files use .ACCDE for the compiled extension.
*** At the time of release of this FAQ article, the Access 2007 RunTime was not available, so testing could not be performed. It is expected that it should perform as stated when finally released.
Another reason that .MDE creation may fail is because there are problems with your code. Since Access has to compile all the code, there cannot be any errors.
-Open the VBA window, (Alt-F11)
-Choose Debug>Compile
-Fix any problems that are found with your code.
After a successful Compile, this option will appear grayed out on the menu.
TIP: Make sure at the top of EVERY module these two lines of code appear:
Option Compare Database
Option Explicit
These lines will make it much easier for you to find errors with your code. Take the time to set this as the default, by going to the VBA window (ALT-11)
-Choose Tools>>Options…
-Choose the Editor tab
-Select Require Variable Declaration
This will add these lines to any new form/report/module that you create. You will be a better programmer for it.
Things to remember
Creating an .MDE file from your database prevents anyone from getting to the VBA code or form/report design - including you. The only way to make design changes is with the original .MDB file.
-Make your changes.
-Re-create the .MDE file.
-Re-deploy the new .MDE to your users.
This makes it EXTREMELY IMPORTANT to keep your original .MDB's in a safe place. Back them up often and store them in multiple locations. They are your only means of doing any future development to your applications. .MDE's cannot be "upgraded" or converted to other versions of Access. You still need the original .MDB to convert to the desired version, and then to convert the resulting .MDB to the .MDE format.
Converting to an .MDE has no effect on tables, relationships, queries, or macros. These items can still be created/modified/deleted after the conversion.
If your VBA source code is password-protected, you need to have access to the code via the password in order to create the .MDE.
If your database is protected by ULS (User-Level Security), conversion to an .MDE is best performed while logged on with full administrative rights to the database. You cannot remove ULS from an .MDE. Remove ULS from the .MDB and then create the .MDE.
If you are converting a replicated database, replication must be removed prior to converting to an .MDE.
Recently, a company [that will not be mentioned here] advertises the ability to decompile .MDE's back into .MDB's when proof of ownership is provided. I personally, have mixed emotions about this, but thought it would be best if developers were made aware of this possibility.
Conclusion:
So give it a try. You've got nothing to lose. Your original .MDB is not altered at all during this process. It is one of the best ways to create moderately secure Access applications.
I would like to thank all the UA members who contributed to this article.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    16th December 2017 - 07:32 PM