Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open a mdb shortcut with switch 1

Status
Not open for further replies.

hovercraft

Technical User
Jun 19, 2006
236
US
Greetings all,

This is a direct copy from a shortcut on my desktop.

"C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE" "C:\PRNIN\SC_New.mdb" /wrkgrp "C:\PRNIN\PB2000.mdw"


I'm trying to use shell to open it but I'm getting an error "you do not have permission"

However when launched from the desktop it's fine.

How can run this shortcut from an on-click event?

Thanks,
Hovercraft
 
Why do you want to open the shortcut?
Wouldn't it be simpler to just use code to open the program that the shortcut opens?


Randy
 
I don't really want to open the shortcut but the mdb. If I try to simply launch the mdb from C:\PRNIN\SC_New.mdb I get the error. If I use the shortcut on the desktop...it works. I'm pretty sure it's because of the "/wrkgrp" in the middle, but I'm not 100%.
 
Code:
FollowHyperlink "C:\FolderName\DatabaseName.mdb"

Randy
 
Thanks Randy, but that is not working. Same error. I think it's because of the /wrkgrp


 
What is your actual code trying to open the DB ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Greetings PHV!

The code = FollowHyperlink ("C:\PRNIN\SC_New.mdb")
I've just tried replacing the path to the mdb with the path going to the desktop shortcut, which works however, I am getting the warnings about "hyperlinks are unsafe, run and hide your children"

I would like to be able to execute : "C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE" "C:\PRNIN\SC_New.mdb" /wrkgrp "C:\PRNIN\PB2000.mdw"


but I suppose as long as it is at least opening the mdb now it's better than nothing.
 
A starting point:
Code:
CreateObject("WScript.Shell").Run "MSACCESS.EXE C:\PRNIN\SC_New.mdb /wrkgrp C:\PRNIN\PB2000.mdw"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top