How to bypass autoexec using OpenCurrentDatabase

S

Shaun

Do you know how to bypass the AutoExec macro of an MDB that you are opening
with the following code snip, just as if you held SHIFT down when you opened
it manually?
Set App = New Access.Application
app.OpenCurrentDatabase, "test.MDB", False
 
T

Tim Ferguson

Do you know how to bypass the AutoExec macro of an MDB that you are
opening with the following code snip, just as if you held SHIFT down
when you opened it manually?
Set App = New Access.Application
app.OpenCurrentDatabase, "test.MDB", False

If you are opening it as an Access Application, then it's reasonable for
the autoexec to run because it may be preparing the user interface or other
control or access mechanisms before showing anything to the user.

If you want to access the data tables, though, then don't bother using the
UI at all; just use the OpenDatabase or CreateConnection methods instead.

Hope that helps



Tim F
 
S

Shaun

I am trying to enumerate the controls on the forms, and the controls on the
reports, within "test.mdb", similar to the way FMS Tools Total Access
Analyzer works. The only way I know of to do this is to open the form with
app.docmd.openform ... so I need to find a way to hold the shift key down as
requested.
 
T

Tim Ferguson

I am trying to enumerate the controls on the forms, and the controls
on the reports, within "test.mdb", similar to the way FMS Tools Total
Access Analyzer works.

I wouldn't dare to try to reverse engineer FMS tools stuff so I wouldn't
know. OLE automation would seem to be the last resort though. Best way
would be to get a suitable agreement with microsoft and use the mdb file
structure.

Just a thought: can you not access the forms and their controls via the
Documents container?

Then again, if I wanted to know how many controls there are on a form, I'd
open it in design mode and count them. But then again, I'm a kind "why make
it more complicated that it needs to be" sort of person...


Best of luck


Tim F
 

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