Open a Database by VB Code to join a different workgroup

Z

Zikar

Hello group members...
I am trying to fire up an event from an unsecured database to launch another
database that is secured completely with defined permissions for users and
workgroups. I am trying to fire up the event by a code as follows:

Dim app As Double
app = Shell("msaccess.exe C:\targetpath\target.MDB /wrkgrp
C:\targetwrkgrp\target.MDW ")

this code does not work!

I can only make it work if I remove the "/wrkgrp C:\targetwrkgrp\target.MDW"
part of this string, but this only makes the target Database open as
unsecured due to it still being joined by default to the same workgroup
(system.mdw) as of the current open database.

I know how to do this by a shortcut but I strictly need to open the target
database by code as to join a different workgroup .

It would be fantastic if someone out there knows how to help me with solving
this issue. Thanks
 
T

Tom van Stiphout

On Thu, 2 Apr 2009 17:28:05 -0700, Zikar

Have you tried using the full path to msaccess.exe?

Another option would be to use the ShellExecute Windows API.

-Tom.
Microsoft Access MVP
 
Z

Zikar

Thanks Tom it did work and you were of great help eventhough I missed out on
such a small thing.

Cheers!
 

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