Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Compile < Hide Folder | Too Many Tables >
Compile
By Richard Rost   Richard Rost on LinkedIn Email Richard Rost   4 years ago

Compile or Decompile a Microsoft Access Database


 S  M  L  XL  FS  |  Slo  Reg  Fast  2x  |  Bookmark Join Now

If your Microsoft Access database is generating random errors that you can't explain or is crashing from time to time unexpectedly, you may want to try compiling your database.

Likewise, if you are trying to create an encrypted front-end ACCDE file, and you get the "Microsoft Access was unable to create the .accde, .mde, or .ade file" error message, you may also want to compile your database.

Compact and Repair doesn't fix the problem? Again, guess what... compile, and if necessary, decompile and recompile your database.

Decompile Command

"C:\Program Files\Microsoft Office\root\Office16\MSACCESS.EXE" /decompile "C:\FullPath\MyDatabase.ACCDB"

Links

Learn More

FREE Access Beginner Level 1
FREE Access Quick Start in 30 Minutes
Access Level 2 for just $1

Free Templates

TechHelp Free Templates
Blank Template
Contact Management
Order Entry & Invoicing
More Access Templates

Resources

Diamond Sponsors - Information on our Sponsors
Mailing List - Get emails when new videos released
Consulting - Need help with your database
Tip Jar - Your tips are graciously accepted
Merch Store - Get your swag here!

Questions?

Please feel free to post your questions or comments below or post them in the Forums.

Keywords

access 2016, access 2019, access 365, microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, #fasttips, compile, decompile, recompile, How do you compile an Access database, Decompile Your Microsoft Access Database, What does compiling an Access database do, How and Why to Decompile an Access Database, Microsoft Access was unable to create the .accde .mde or .ade file., compact, repair

 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to Compile
Get notifications when this page is updated
 
Intro In this video, we'll talk about compiling your Microsoft Access database, including how to manually compile your VBA code, why compiling is important for eliminating random errors and issues when creating an ACCDE file, and how to use the decompile command if compiling alone doesn't solve your problems. You'll see common troubleshooting steps, learn how to spot coding mistakes that can break your database, and get tips for addressing persistent errors that occur during distribution or routine use.
Transcript Welcome to another Fast Tips video brought to you by AccessLearningZone.com. I am your instructor, Richard Rost.

In today's video, we're going to talk about compiling your database: how and why you should compile your Microsoft Access database.

So you've built your database. Everything seems to be fine most of the time, but you're getting crazy random error messages that you can't explain, or Access is crashing for no apparent reason, or you're trying to create an encrypted ACCDE file because you're going to distribute it as a front end, and compact and repair doesn't seem to help with any of these problems. You might have something weird and crazy going on in your database.

How do you fix it? The first thing you're going to do is compile your database. Go into your Visual Basic Editor, click on Debug, and then compile whatever your database name is. Do that, and the compiler might stop if it recognizes any problems. For example, if you typed in "message box" wrong. It may do nothing, it may just compile in the background and everything seems to be okay. But generally, it will point out something wrong in your VBA somewhere.

Now, go use your database or, if you're trying to create an encrypted front end, create your ACCDE file again now.

If you don't know what this is, I have a video on it called "My Simple Security Video" where I show you how to create an encrypted executable-only file that you can distribute to your users. If you can do this, if this step completes successfully, chances are your VBA is fine.

What exactly is compiling your database? VBA is basically close to English. It's all plain text written so that a human can understand it. When you compile your database, it essentially translates that text into something the computer can more easily read.

Access doesn't always compile every part of your database every time you use it. It compiles only what it needs, and sometimes pieces of that can get corrupted. So after compiling, if you still have problems, you can try decompiling the database.

Decompiling is a little more involved. You have to close Access down, open a command prompt, and then type in what I've got there. Type inside quotes the full path to wherever you installed Access; you picked this location when you installed Office. It's usually either this folder or this folder if you went with the defaults; it depends on your system. Then type a space, then forward slash decompile, then another space, then inside quotes the full path and file name to your database. Press Enter and nothing will appear to happen, but Access will take all the machine code in your database and revert it back to a raw data format, basically. It's technical. But essentially, now that you've decompiled the entire database, you can go back in and recompile it again. This is in case any of the compiled code got messed up.

Sometimes, like eggs, it gets scrambled. So you compile it. If it still doesn't work, you decompile it, then you compile it again, and now try to make your ACCDE file. If it still doesn't work, you have a deeper problem.

If you're still having problems, go to this page and run down my troubleshooter. There are all kinds of different solutions on here. I've tried to organize the list from the easy stuff that tends to work the most all the way down to the hard stuff. There's a video here you can watch. You can check your backups, restart Access, restart all your databases, compact them, repair them, compile and decompile. Then we have steps like restart Office, reboot the PC, and so on. From the easy stuff down to the hard stuff.

Nine times out of ten, when people have this problem, when their database won't compile or they're getting random error messages, it's because you've got a problem somewhere in your code. Actually, something is spelled wrong like I did here. It didn't run because you could have code in one of your forms behind a button that you never pressed after you wrote it, but it could be causing problems somewhere else. It would cause your database not to compile when you try to create that ACCDE file. When you do that, Access is going to compile all the code, even code you might not have run since you wrote it.

That happens to me all the time. I'll make a little change here, a little change there, spell something wrong, copy and paste something wrong. Then I go to make my ACCDE file and it won't go because I got a typo in my code somewhere. Ninety percent of the time that's what it is.

Let me walk you through a little bit of this. Here's my TechHelp database. You've probably seen this before if you've watched any of my other videos. Let's intentionally put an error in here. I'm going to Design View. Let me open up one of these buttons and I'll put a bad piece of code in here, MS box. Hi, I'm trying to message box "Hi," but I spelled message box wrong and I didn't catch it.

So I close this, close this, I'm moving along using my database, doing stuff. I never noticed that error because I didn't click that button. If you click the button, you're going to get that, but let's pretend that didn't happen. I didn't click it.

Now it's time to distribute my front end, and I go to File, Save As, make an ACCDE file, and give it a location. Save. And Access was unable to create the ACCDE file. Why? It doesn't tell you why. It doesn't say, oh, you typed in message box wrong. It just doesn't tell you. Now you're back in your database.

So go back into your code. I have a little button up here on my Quick Launch Toolbar. Open up the code editor. Doesn't matter if you're in the right spot. Just hit Debug, Compile, and it takes you right to the problem. And you can go, oh, that's what it is. At least it pointed you right to what your problem is. So I can fix that or just delete it. Then compile again. Every time you compile, get an error message, do it again until you don't get an error message.

Now if I drop this down you can see it's grayed out. That means this entire database has been successfully compiled. The whole thing. Now I should be able to go File, Save As, make ACCDE file. Click Save. Looks like it made it. And yes, I do see it on my desktop. It's right there.

This is not only for compile errors where you've got some bad code, but like I said before, when Access runs your database, it might compile things in pieces. It doesn't necessarily compile the whole database unless you manually compile it. So you could have something messed up in a pre-compiled piece that is causing the whole database that problem. That's where you might need to decompile it.

Let me get rid of this. Now decompiling is a little more tricky. Whenever it comes time to do something like this with the command prompt, I like to use Notepad. I'm going to open up Notepad first. I like to put my commands in Notepad and then copy them into the command editor.

What we're going to do is find Access. I have a shortcut there, but you might have to go to your Start menu, find Access, right click on it, go to More, and then Open File Location. That's going to open up your Windows File Explorer. That's going to put you where that shortcut to Access is. This isn't what we want though. See, we're just in our Start Menu. Now we want to right click on this guy and go to Properties. This is what we're looking for - that Target. Copy, Control C. That is the full path to wherever Microsoft Access is on your system. Paste it in there, then space, then forward slash decompile.

Now we're going to do the same thing with our TechHelp database file, which is sitting on my desktop. So you're going to go to C, it's usually under Users, your username, mine is amaker. It was amacron, but for some reason it got cut short and I just never bothered to fix it. Amakron Desktop.

Now my TechHelp database is right there. So I'm going to copy this from the address bar up top, put it inside quotes and then backslash techhelp.accdb. There's the command that I need right there. It's different for everybody because your Microsoft Access.exe might be in a different folder than mine, and your database is definitely going to be in a different folder than mine.

That's your command. Copy this whole thing to the clipboard, Control C. Now open up the command editor. Start, type in cmd, there's your command prompt, click on that. That opens up this window. Paste, and then press Enter. Now your database will open up. There it is. Database opened up and you can see from the editor, nothing appears to happen in the editor window, so you can close that now.

This is basically an undocumented feature that Microsoft didn't really tell anybody about. This is supposed to be for their developers. Just in case you're curious, there is no way that you can take an encrypted ACCDE file and decompile it to get the VBA back out of it. That's impossible. There are some third party utilities I've seen online that claim to do that. I've never tested any of them, but I don't trust them.

Now we're in our decompiled database. Go back into your code editor, Debug, Compile again. It should go through and compile completely. Now you've decompiled it so you've removed all the machine code from the back end, and then you recompiled it all back into fresh machine code.

If you want to learn all the nerdy details, there's an excellent article written by fellow Access MVP, Philip Stefel. It's on his website. I'll put a link there. You can click on it down below too. Excellent article that goes over all the details about compiling VBA into pseudo code and more detail than I went into. If you care about all the nitty gritty details, check his article out.

Special thanks also to Mike Wolf over at NoLongerSet.com. It's funny because I've been planning on putting together a video on compiling and decompiling your database for a while now because it's a common question I get all the time. I read his blog every day and he just happened to post this. So Mike, thanks for pointing me in the direction of Philip's article. We're all one big, happy Access community. I highly recommend Mike's blog, go check it out.

So that's it. That's why you want to compile and, if necessary, decompile your database. If you have any questions, let me know. I hope you learned something, and of course, we'll see you next time.
Quiz Q1. What is the primary purpose of compiling your Microsoft Access database?
A. To translate VBA code into a format the computer can read more efficiently
B. To encrypt your database for distribution
C. To create a backup of the current database file
D. To add new tables automatically

Q2. When might random error messages or crashes in Access indicate it is time to compile your database?
A. When you change a table field type
B. When compact and repair do not fix unexpected issues
C. When you import new data
D. When you set up user-level security

Q3. What will the Access compiler do if it finds an error in your VBA code during compilation?
A. It will point out the error's location in your code
B. It will automatically correct the error
C. It will delete the form with the error
D. It will ignore the error and continue compiling

Q4. What is an ACCDE file in Microsoft Access?
A. A compiled, encrypted front-end file meant for distribution
B. A backup file of your database
C. A simple unsecured copy of your database
D. A file format for storing images

Q5. What does manually compiling your database ensure that Access does not always do automatically?
A. It ensures all VBA code in the database is compiled, not just pieces
B. It deletes existing forms with errors
C. It updates all queries in the background
D. It creates new user accounts

Q6. What is the process of decompiling a database intended to fix?
A. Corrupted or scrambled compiled code in the database
B. Lost table data
C. Broken relationships between tables
D. Missing database icons

Q7. Which of the following is NOT a correct step for decompiling an Access database?
A. Typing the path to Access and using the /decompile switch in a command prompt
B. Running the command with the database file path in quotes
C. Restarting Access after typing the /decompile command
D. Defragmenting your hard drive before compiling

Q8. Why might you not notice a VBA error in your database right away?
A. The faulty code is behind a form or button that you have not executed
B. Access always notifies you of code errors instantly
C. VBA code is always compiled automatically
D. Forms cannot contain VBA errors

Q9. What should you do if compiling and decompiling do not resolve your issues?
A. Follow a troubleshooting checklist with progressively more advanced solutions
B. Immediately create a new database from scratch
C. Reinstall Windows
D. Ignore the problem

Q10. Which of the following best describes what decompiling does to your database?
A. It strips out all compiled machine code, reverting to raw VBA for recompilation
B. It encrypts the code to prevent editing
C. It merges tables and queries
D. It creates a backup copy of your database

Q11. Can you decompile and extract VBA code from an encrypted ACCDE file?
A. No, this is not possible through decompiling
B. Yes, with the /decompile command
C. Yes, if you know the password
D. Yes, by converting the file to ACCDB first

Q12. If Access won't create an ACCDE file, what is the most likely cause according to the video?
A. There is a code error somewhere in your VBA
B. The database is too large
C. Your file system is full
D. You are using an old version of Access

Answers: 1-A; 2-B; 3-A; 4-A; 5-A; 6-A; 7-D; 8-A; 9-A; 10-A; 11-A; 12-A

DISCLAIMER: Quiz questions are AI generated. If you find any that are wrong, don't make sense, or aren't related to the video topic at hand, then please post a comment and let me know. Thanks.
Summary Today's video from Access Learning Zone covers the process of compiling your Microsoft Access database, and why this step is crucial for database reliability and distribution.

Once you've created your database and everything appears to function properly, you might still encounter mysterious error messages, unexplained crashes, or trouble creating an encrypted ACCDE file to distribute as a front end. Even after running a compact and repair, these issues may persist, signaling that there could be a deeper problem within your database.

The first step to troubleshooting is to compile your database. Open the Visual Basic Editor, then choose the option to compile your database from the Debug menu. If the compiler detects issues, such as a typo in your code, it will stop and alert you to the specific location of the error. Sometimes, the compile might finish without any errors, but generally, if there's a problem in your VBA, this process will reveal it.

After compiling, you should try using your database again. If your goal is to produce an encrypted ACCDE file, attempt that step once more. If you are unfamiliar with creating ACCDE files, I have a dedicated video where I demonstrate how to create a secure, executable-only version of your database to share with others. If you successfully create an ACCDE file after compiling, your VBA code is likely free of errors.

Compiling, in simple terms, translates your readable VBA code into a format that your computer can process more efficiently. Access, however, does not automatically compile your entire database every time it runs; it only compiles sections as needed. Over time, some of these sections might become corrupted. If compiling alone does not resolve your issues, the next step is to decompile your database.

Decompiling is a bit more technical. Start by closing Access and opening a command prompt. Once there, you'll need to enter a command that uses the path to your Access program and your database file, along with the decompile switch. After executing the command, nothing visible will happen at first, but Access will convert all the machine code in your database back to a raw format. This gives you the opportunity to recompile everything from scratch, which often resolves corruption in compiled code.

Think of it like scrambling eggs. Sometimes the code gets jumbled up, which can lead to problems. By compiling and, if necessary, decompiling, you often clear out these errors. If you still cannot create an ACCDE file or continue to get error messages, you may be facing a more difficult issue.

If you've gone through these steps and continue to have trouble, I recommend visiting my troubleshooting page, where I've organized solutions from the simplest fixes to more advanced techniques. This resource covers everything from checking your backups and restarting Access to compiling, decompiling, and even rebooting your entire system.

In the vast majority of cases, when users have problems compiling their database or receive random errors, it is due to an issue in their code. You may have a simple typo or an error in VBA that you have not noticed, especially if the problematic code is located behind a button or feature you rarely use. When you attempt to create an ACCDE file, Access tries to compile all the code in your database, including sections you may not have recently used or tested.

For example, if you made a minor change such as misspelling "message box" and forget to test that button, creating an ACCDE file would fail without specifying the cause. Compiling in the Visual Basic Editor points you directly to the error, allowing you to correct it. After correcting and recompiling, once the compile option becomes unavailable or grayed out, your database is fully compiled, and you should be able to produce the ACCDE file successfully.

On rare occasions, the problem lies in a deeper part of the compiled code, which is when decompiling comes into play. To do this, I find it easiest to create the command in Notepad first, copying the Access path and your database path to ensure accuracy. Once you've constructed the correct command with the decompile switch, paste it into the command prompt and run it. Afterward, reopen your database, compile it again, and try creating your ACCDE file. The process removes malfunctioning machine code and regenerates it properly when you recompile.

Microsoft never widely publicized decompiling, but it's a helpful tool for developers. It's important to note that encrypted ACCDE files cannot be decompiled to recover their VBA code, contrary to claims made by some third-party tools. I would not recommend trying any of those, as they are neither reliable nor trustworthy in my experience.

If you are interested in the technical details of how compiling works within Access, there is an excellent article by Access MVP Philip Stefel that I highly recommend. It explains the process of translating VBA code into pseudo code in detail. Also, special thanks to Mike Wolf of NoLongerSet.com for pointing out Philip's article and for his ongoing contributions to the Access community.

To sum up, compiling and, if needed, decompiling your database are fundamental steps in resolving odd errors and ensuring your ACCDE files are created without issues. If you have any further questions, feel free to reach out.

You can find a complete video tutorial with step-by-step instructions on everything discussed here on my website at the link below. Live long and prosper, my friends.
Topic List Compiling a Microsoft Access database in VBA editor
Troubleshooting random error messages in Access
Creating an ACCDE file after compiling
Understanding the compiling process in Access
Identifying and fixing VBA code errors
Decompiling a Microsoft Access database using command prompt
Steps to find the Access executable file path
Building the decompile command with file paths
Running decompile from the Windows command prompt
Recompiling after decompiling the database
Resolving compile errors to enable ACCDE creation
Recognizing causes of failed ACCDE file creation
Difference between compiling and decompiling in Access
Using Notepad to build command line statements
Access's compile vs. on-demand compilation behavior
 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/10/2026 7:38:02 AM. PLT: 0s
Keywords: FastTips Access compile, decompile, recompile, Microsoft Access was unable to create the .accde .mde or .ade file., How do you compile an Access database, Decompile Your Microsoft Access Database, What does compiling an Access database do, How and Why to   PermaLink  Compile or Decompile Your Microsoft Access Database