When Shelling to another database to bypass workgroup dialog box

J

John Baker

I have some code which opens another access database.
The code is: (which works fine)

Const q As String * 1 = """"
strUpdateTool = "C:\Program Files\Microsoft
Office2003\OFFICE11\MSACCESS.EXE " & q & strPath & q & " /wrkgrp " & q &
wrkgrpPathAndName & q & " /user Administrator /pwd aaa " & q
Shell strUpdateTool, vbNormalFocus


I am trying to avoid reentering the username and password when the new
database opens
The code seems to work fine and it selects the correct workgroup file but it
still displays the dialog box to enter the password. The password section is
blank.

Any ideas?

Any help greatly appreciated.
John B
 
A

Albert D.Kallal

Const q As String * 1 = """"
strUpdateTool = "C:\Program Files\Microsoft
Office2003\OFFICE11\MSACCESS.EXE " & q & strPath & q & " /wrkgrp " & q &
wrkgrpPathAndName & q & " /user Administrator /pwd aaa " & q
Shell strUpdateTool, vbNormalFocus

You need quotes around the user name, and the password...since they could
have spaces...

& " /user Administrator /pwd aaa " & q

needs to be

& " /user " & q & "Administrator" & q & " /pwd " & q & "aaa" & q
 
J

John Baker

Thanks Albert it worked a treat

John B

Albert D.Kallal said:
You need quotes around the user name, and the password...since they could
have spaces...

& " /user Administrator /pwd aaa " & q

needs to be

& " /user " & q & "Administrator" & q & " /pwd " & q & "aaa" & q


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(e-mail address removed)
http://www.members.shaw.ca/AlbertKallal
 

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