Difference between compiled code and .accde

mcdhappy80

Registered User.
Local time
Today, 16:39
Joined
Jun 22, 2009
Messages
347
What is the difference between compiling the code from Debug -> Compile menu in VBA editor and making the database .accde format?
 
From Microsoft website: LINK HERE

.accde This is the file name extension for Office Access 2007 files that are compiled into an "execute only" file. This format takes the place of the .mde file name extension that is used in earlier versions of Access.
An .accde file is a "locked-down" version of the original .accdb file. If the .accdb file contains any Visual Basic for Applications (VBA) code, only the compiled code is included in the .accde file. As a result, the VBA code cannot be viewed or modified by the user. Also, users working with .accde files cannot make design changes to forms or reports. You create .accde files from .accdb files by doing the following:

In Office Access 2007, open the database that you want to save as an .accde file.
On the Database Tools tab, in the Database Tools group, click Make ACCDE.
In the Save As dialog box, browse to the folder in which you want to save the file, type a name for the file in the File name box, and then click Save.

This may not be exactly the case, but this is the way I understand it. As you work with MS Access, as you make changes, access keeps a record of these changes. Compiling your code helps access sort out any problems, and it will usually highlight any problems it finds.
Applying the format you suggest makes the database partly protected, in Access 2003 this was called an MDE file, your user is restricted and not allowed to make certain changes.
Also in Access 2003 you would occasionally get an access database that was corrupted, particularly if you were making quite a few changes in the design. One way to avoid this would be to run what was called a “de-compile” I’m not sure if this is necessary with Access 2007, however it might be worth asking the question as it was generally a good idea to de-compile your Access 2003 database before making it into an MBE database. If you didn’t, then very often it wouldn’t convert properly.
 
Thanks for such a detailed answer Uncle Gizmo. :)

My next question would be, can I first compile the code in VBA editor and then make .accde?

I would definitely like to protect my code and database from modification, so I would surely make database .accde before deployment, I only need to know should I compile the code in VBA before making it .accde?

Thank You.
 

Users who are viewing this thread

Back
Top Bottom