Script Opens Target File, Then Says It Can't Find The File?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Dexter1
Pro Scripter
Posts: 64
Joined: Mon Jun 19, 2006 3:28 pm

Script Opens Target File, Then Says It Can't Find The File?

Post by Dexter1 » Thu Nov 05, 2009 4:07 pm

I have the following script which I use a desktop shortcut for an Access application.

Code: Select all

ExecuteFile>C:\Documents and Settings\%User_Name%\OA Change 2009\OA_Change_2009.accdb
The database is definitely in the location outlined below. Not only did I double-check manually, the script actually opens the target file. However, after the database is open I get an error that the target file cannot be found. This doesn't affect database funcitonality but I keep getting people who think there is something wrong with the database. And even if they didnt' call me, they shouldn't have to click through an error every time they access the database.
Thanks,
Josh

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Nov 05, 2009 5:36 pm

Does the database access some other file(s)? Maybe it needs to have CWD set to it's location (or somewhere else):

Code: Select all

ChangeDirectory>C:\Documents and Settings\%User_Name%\OA Change 2009
ExecuteFile>C:\Documents and Settings\%User_Name%\OA Change 2009\OA_Change_2009.accdb
What does a desktop shortcut to the database look like? Does it have a Start In folder?

Does it work better if you use Run Program - presumably something like:

Run>"c:\path\to\access\msaccess.exe" "C:\Documents and Settings\%User_Name%\OA Change 2009\OA_Change_2009.accdb"
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts