a) Noted access keeps two copies of the code. Does access remove
the compilation (decompile?) every time I edit the code?
VBA compiles different parts incrementally, so there can be many
different stages. Michael Kaplan, who knows about these things,
posted that there are ELEVEN states of compilation, and writes:
Thats right, internally there are 11 different compilation
levels between decompiled and fully compiled like you would find
in an MDE. As you make objects dirty, you will decompile the
project, but dirtying Module1 does not remove all the "compiled"
info about Module2 or Form1, for example. The exact levels are
impossible to even detect unless you have source and debugging
symbols for VBA, and insanely difficult even then.... so lets
just leave it as read that the yes/no question of "is it
compiled?" has many subcategories under the NO answer that
essentially mean its not compiled but some parts of it are kind
of.
From "The real deal on the /Decompile switch"
http://trigeminal.com/usenet/usenet004.asp?1033
I found a strange
behavious of access - I add objects, code etc. to the app, do a
compile and the file size bloats. No amount of compacting reduces
the filesize. Then after few days, when I run a routine compact
process the file size drops several MBs (say from 10MB to 6MB) -
seemingly without any reason. Why is this happening?
Good question. It could be that the compact routine has some
internal thresholds and won't discard data pages except in
increments, i.e., only every 1MB or something like that. I don't
think it works that way for data tables, but it might for the VBA
project.
I'm pretty certain that a regular compact does *not* delete
discarded p-code pages (i.e., the compiled VBA code), because that's
internal to the BLOB field in which the entire Access project is
stored. My guess is that certain cleanup routines kick in via VBA at
certain points when the BLOB field gets too disordered. But I'm only
guessing on that.
I try to keep that BLOB field as clean as possible by keeping
COMPILE ON DEMAND turned OFF, compiling frequently and
decompiling/compacting/compiling on a regular basis. I consider it
part of good housekeeping to keep things running smoothly, somewhat
like keeping the tires on your car properly inflated and changing
the oil regularly. If you never do the things I recommend, it would
be just like running your car without ever doing those maintenance
tasks -- eventually, the car is going to stop running.
b) How do I decompile the code manually?
I recently posted detailed instructions in this thread on
Stackoverflow.com:
http://stackoverflow.com/questions/1147702/rookie-ms-access-creating-
the-front-end-mde/1148573#1148573