ACC: Visual/Access Basic Is Both a Compiler and an Interpreter

This article was previously published under Q109382
This article has been archived. It is offered "as is" and will no longer be updated.
Novice: Requires knowledge of the user interface on single-user computers.

This article discusses whether the Visual Basic for Applicationsprogramming language (or the Access Basic programming language in version2.0 or earlier) is a compiled language or an interpreted language.
Traditional compiled languages, such as C, compile human-readable sourcecode into machine-readable, and much faster, object code. These objectprograms then need to be linked into an executable file to be used.Syntax errors are not generally located until the code is completelycompiled. (Parsing compilers are an exception.)

Traditional interpreted languages, such as QBasic, use interpreters thatread each line of code and translate it into computer instructions asyou write it. An advantage of this method is that an interpreter can testyour code as you write it. In some cases this line-by-line interpretationcan be slow.

Visual Basic incorporates elements of both compiled and interpretedlanguages. Visual Basic does interpret each line of code as you writeit, but Microsoft Access performs this interpretation in the background,and does not exhibit any performance degradation because of thisinterpretation.

In addition to this interpretation, Microsoft Access also compiles yourcode into a combination of compiled and interpreted code known as p-code,or pseudocode. This p-code runs much faster than interpreted code. Thecompilation takes place either when you first run the code, or when youclick Compile All on the Run menu.

Microsoft Access 97 also provides another mechanism for keeping databaseapplications compiled and secure. This feature is called Make MDE File.It removes the text representation of your Visual Basic for Applicationscode and stores just the binary compiled p-code.

If your database contains Visual Basic code, saving your database as anMDE file compiles all modules, removes all editable source code, andcompacts the destination database. Your Visual Basic code continues torun, but it cannot be viewed or edited, and the size of your database isreduced due to the removal of the code.

Saving your database as an MDE file prevents the following actions:
  • Viewing, modifying, or creating forms, reports, or modules in Design view.
  • Adding, deleting, or changing references to object libraries or databases.
  • Changing code using the properties or methods of the Microsoft Access or VBA Object models because an MDE file contains no source code.
  • Changing your database's VBA project name using the Options dialog box.
  • Importing or exporting forms, reports, or modules. However, tables, queries, and macros can be imported from or exported to non-MDE databases. Any tables, queries, or macros in an MDE database can be imported into another database, but no forms, reports, or modules can be imported into another database.
security lock

Article ID: 109382 - Last Review: 12/04/2015 09:54:19 - Revision: 2.1

Microsoft Access 1.0 Standard Edition, Microsoft Access 1.1 Standard Edition, Microsoft Access 2.0 Standard Edition, Microsoft Access 95 Standard Edition, Microsoft Access 97 Standard Edition

  • kbnosurvey kbarchive kbinfo kbprogramming KB109382