Hide automation instance of Access 2003

  • Thread starter Sergey Poberezovskiy
  • Start date
S

Sergey Poberezovskiy

Hi,

I am using Access 2003.
When I open another instance of Access via Automation, it
will ALWAYS become visible after executing the
OpenCurrentDatabase method.
Is there any way not to show another instance as it was
possible back in 2000 version (I have not checked XP).
The code:

Dim oAccess As Access.Application
Set oAccess = New Access.Application
With oAccess
' As the other database contains VBA code skip the
security prompt
.AutomationSecurity = msoAutomationSecurityLow
.OpenCurrentDatabase "c:\dev\bbb.mdb"
Debug.Print .Visible ' will print True
' some other code - just data processing (visual
interface is not used)
.CloseCurrentDatabase
.Quit
End With

The question again:
How to stop showing the automation instance of Access?

Any help is much appreciated..
 
6

'69 Camaro

Hi, Sergey.

Have you tried the "Visible" Property? You can set it to False after
opening the other database, like this:

oAccess.Visible = False

However, there are some operations you can do remotely that will *always*
show the Access database application, even if you've turned the visibility
off. In that case, use the "Echo" method:

oAccess.Echo False
' Do stuff that needs to be hidden from user.
oAccess.Echo True

.... and then make sure that your error handler sets Echo back to True
whenever your application encounters an error while the above code is
running.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.
 
S

Sergey Poberezovskiy

I will try Echo method and will let you know of the
outcome, but in about 8-9 hours time as I am not currently
on site. Setting Visible property after
OpenCurrentDatabase will still activate Access window
while opening - so that is not an option.
 

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