[AccessD] 32->64 bit conversion

Paul Wolstenholme Paul.W at industrialcontrol.co.nz
Sun Oct 31 15:36:57 CDT 2021


Jim,

Thanks for the clear explanation.

You have just explained that there is one caveat, but only for .accde
files:  Conditional compilation code distributed in a .accde will only work
if the issuing computer and the user computer evaluate the compilation
conditions as being the same.
And I've learnt that I should compile my application before issuing it
rather than compacting it (meaning I send a slightly bigger file).

So if Arthur doesn't use .accde files he can use conditional
compilation freely.

Paul Wolstenholme

On Sat, 30 Oct 2021 at 00:23, Jim Dettman via AccessD <
accessd at databaseadvisors.com> wrote:

> Paul,
>
> << Should conditional compilation only be used in Access with some
> prescribed
> caveats?>>
>
>   There really are none, and you should not leave a project in an
> un-compiled state as it will run slower.
>
>    VBA has two major steps when working with code:
>
>     1. When you enter a line of source, the text is tokenized and checked
> for basic syntax errors.
>     2. VBA "compiles" the tokenized code, which basically means it goes
> through a whole bunch of checks to figure out how all that code relates and
> if it's valid.   Last I knew, there were more than sixteen levels that the
> compiler would d code through before it was considered "compiled".    I'm
> putting compiled in quotes because un-like a lot of other languages where
> you end up with an .EXE, VBA doesn't do the same thing (it's not linked
> code).   Even with compiled code, it's still figuring out how to execute it
> at run time.    When you "compile" your VBA project, it's just cutting out
> some of those checks.
>
>     You can have a VBA project with just source and no compiled code.
>  That's what /decompile leaves you with.   Any compiled code is marked as
> invalid and it will be removed when a compact and repair is done.
>
> <<<< I understand Access likes to pre-compile its source and save it in the
> database file (the front end in a FE-BE system).>>
>
>  VBA doesn't do that on its own.   You must explicitly tell it to do
> that.   But VBA only executes compiled code, so if you don't do it before
> hand, it will compile at runtime.   It just won't save it.
>
>  << If the source is written for conditional compilation (conditional
> according
> to how Access was installed on the computer) how does Access know when
> recompilation is required?>>
>
>    I don't know for sure, but I would think it simply checks the values of
> any compiler constants against what the compiled code was compiled
> against.   If it spots a difference, then it compiles everything again,
> just as it would if you changed a line of code.
>
>    With 32 vs 64 bit, that's what happens.   If you compile 32 bit,
> distribute as an .accdb, then run in 64 bit, VBA can (and does) compile on
> the fly.   But if you distribute as an .accde (which has no source), then
> it cannot and won't run.
>
> HTH,
> Jim.
>
>


More information about the AccessD mailing list