Automation Error - More Information?

Automation Error - More Information?

Anonymous
Not applicable
498 Views
3 Replies
Message 1 of 4

Automation Error - More Information?

Anonymous
Not applicable
I develop/support approximately 40 AutoCAD vba applications. Occassionally
the users get an "Automation Error" (see attached picture) when running
various vba programs. Basically when the error occurs it crashes AutoCAD.
It is very sparatic so it's not easily duplicated so it makes it a real pain
to try and debug the problem. Can anyone give me some ideas as to why this
error occurs or what it means?

Other Details (if any of this helps):
- The users run the vba projects (.dvb) from their local machine.
- Several of the projects connect to an Access Database located on the local
area network (Windows Server 2003). They access the database for reading
only. (Microsoft.Jet.OleDB.4.0)
- Several of the projects use a MsFlexGrid control, if that matters.


Mel
(WinXP, AutoCAD 2007 SP1)
0 Likes
499 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
"Mel" wrote in message
news:5410206@discussion.autodesk.com...
I develop/support approximately 40 AutoCAD vba applications. Occassionally
the users get an "Automation Error" (see attached picture) when running
various vba programs. Basically when the error occurs it crashes AutoCAD.
It is very sparatic so it's not easily duplicated so it makes it a real pain
to try and debug the problem. Can anyone give me some ideas as to why this
error occurs or what it means?

Other Details (if any of this helps):
- The users run the vba proje
cts (.dvb) from their local machine.
- Several of the projects connect to an Access Database located on the local
area network (Windows Server 2003). They access the database for reading
only. (Microsoft.Jet.OleDB.4.0)
- Several of the projects use a MsFlexGrid control, if that matters.


Mel
(WinXP, AutoCAD 2007 SP1)

you probably know all this already but fwiw my 2c follows
sounds like either an object went out of scope before some call to the
object
or the database connection was lost due to some cause
i'm adding logging to text file in all my projects these days so when things
go south i can find what the last call that passed was and what error is
returned.
I assume you're checking state on recordsets or connections before accessing
them?
if oConn.State = adStateOpen then....etc
all i know to do is liberal error checking at every point in the process and
the log to textfile is a lifesaver especially if the app is crashing as you
state.(so there's no ability to check errors via debug.print)

if you log to file, have the file point to a network location you have
access to
i create a filename based on routinename/user login/ and time/date so you
can easily find the current problem file

this creates lots of logfiles which then need to be purged regularly but
really helps me while debugging apps so the trade off is well worth it imho
hth
mark
0 Likes
Message 3 of 4

Anonymous
Not applicable
Thank you so much for the info. I'll see if I can implement a log file, that
will really help me out.

Another thing. Is it better to open a database connection once when the
program begins and close it when the programs ends? I noticed one
particular program opens and closes the connection repeatedly as it needs
it. Which is better? Maybe this is a reason why I get occasional crashes??


"MP" wrote in message
news:5410246@discussion.autodesk.com...
"Mel" wrote in message
news:5410206@discussion.autodesk.com...
I develop/support approximately 40 AutoCAD vba applications. Occassionally
the users get an "Automation Error" (see attached picture) when running
various vba programs. Basically when the error occurs it crashes AutoCAD.
It is very sparatic so it's not easily duplicated so it makes it a real pain
to try and debug the problem. Can anyone give me some ideas as to why this
error occurs or what it means?

Other Details (if any of this helps):
- The users run the vba proje
cts (.dvb) from their local machine.
- Several of the projects connect to an Access Database located on the local
area network (Windows Server 2003). They access the database for reading
only. (Microsoft.Jet.OleDB.4.0)
- Several of the projects use a MsFlexGrid control, if that matters.


Mel
(WinXP, AutoCAD 2007 SP1)

you probably know all this already but fwiw my 2c follows
sounds like either an object went out of scope before some call to the
object
or the database connection was lost due to some cause
i'm adding logging to text file in all my projects these days so when things
go south i can find what the last call that passed was and what error is
returned.
I assume you're checking state on recordsets or connections before accessing
them?
if oConn.State = adStateOpen then....etc
all i know to do is liberal error checking at every point in the process and
the log to textfile is a lifesaver especially if the app is crashing as you
state.(so there's no ability to check errors via debug.print)

if you log to file, have the file point to a network location you have
access to
i create a filename based on routinename/user login/ and time/date so you
can easily find the current problem file

this creates lots of logfiles which then need to be purged regularly but
really helps me while debugging apps so the trade off is well worth it imho
hth
mark
0 Likes
Message 4 of 4

Anonymous
Not applicable
Mel,

This sounds like something typical up on Microsoft Support pages where:

"When using Early Binding these issues occur when the code makes an unqualified method call or property call to an object."

Have you tested for results when late bound?

G'Luck

Bob Coward
0 Likes