Compiling all code?

C

Ceasarina

I´ve developed an application in Access 97. Some users have AutoCad and the
application have references to AutoCad and writes to dwg-files. Some other
users do not have AutoCad and therefore the application removes all broken
references at start. Used to work fine.
Then I converted to 2000. Suddenly the application wasn´t able to remove
broken references. Ok - I worked around the problem by doing the other way
around - the standard version didn´t have any references, but if the user was
somebody with AutoCad on the machine then references were created.
But now, when the user without AutoCad is trying some actions that has
worked before, Access is trying to compile ALL code (at least the code in a
module that has absolutely nothing to do with the event) and then generates a
compile-error because in that module I declare variables of AutoCads types.
Anybody have any explanation? Any ideas of how I can solve this?
Thank in advance!
 
N

Naresh Nichani MVP

Ceasarina said:
I´ve developed an application in Access 97. Some users have AutoCad and the
application have references to AutoCad and writes to dwg-files. Some other
users do not have AutoCad and therefore the application removes all broken
references at start. Used to work fine.
Then I converted to 2000. Suddenly the application wasn´t able to remove
broken references. Ok - I worked around the problem by doing the other way
around - the standard version didn´t have any references, but if the user was
somebody with AutoCad on the machine then references were created.
But now, when the user without AutoCad is trying some actions that has
worked before, Access is trying to compile ALL code (at least the code in a
module that has absolutely nothing to do with the event) and then generates a
compile-error because in that module I declare variables of AutoCads types.
Anybody have any explanation? Any ideas of how I can solve this?
Thank in advance!
 
N

Naresh Nichani MVP

Hi:

One way to solve problem is to goto use LateBinding to refer to the AutoCAD
Object Model and use the numbers instead of the Constants.

In Late Binging there is not explicit reference to AutoCAD Libarary - you
declare the ACadApplication, ACadDrawing etc. all as Objects. It is hard to
code but will work on all machines.

Dim ACadApp as Object
Set ACadApp = CreateObject(,"AutoCad.Applciation")

This would create instnace of AutoCAD

If you are using a Contstant get the vale of the constant and replace with
real number. You can get this by going to AutoCad and opening the Visual
Basic for Applications Editor and typing CTRL+G to get the Immediate Window.
Here type
?Constant and press Enter to get the number valid of constant.

Regards,

Naresh Nichani
Microsoft Access MVP
 
C

Ceasarina

Thank you for answering!
I do have a lot of code that I will have to go through and change if I must
change to LateBinding.
For now I have made 2 applications (one without any calls to Autocad).
I would like to understand why it worked in 97 but not in 2000?
Would it help if I konverted to 2002 or 3?
Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top