access not finding file when run from batch file

Hi,

I have a batch file running on a client PC with a single line which looks like this (server name etc changed for security reasons)

"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" "\\mySserver\myDirectory\myDatabase.mdb" /cmd "myParameter"

When I run the file on the client PC by double clicking it, it runs perfectly fine and opens the database with the parameter. When I run the file from myServer over the network it opens access and I get an error message which reads 'Microsoft Access can't find the database \\mySserver\myDirectory\myDatabase.mdb'

I don't understand why the same batch file will run correctly locally but not when run over the server. I've tried putting echo hello just to test the batch file is running properly and it is fine.

So is this a problem with access? Should I write the path differently? I've tried using the same system to run a local database file and hit exactly the same issue.

Please help! I'm tearing my brain out through my eye sockets on this one!

Thank you :)
LVL 2
daz84Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewCommented:
How are you running the bat file remotely?  What credentials are being used in each case?

~bp
0
daz84Author Commented:
I am using pcexec from sysinternals.com with the following command line

psexec "\\myClient" -i "C:/myDirectory/myBatch.bat"

that line is actually called using the shell function in a VB6 program

the batch file runs perfectly well when called remotely from the VB6 software on the server, it will display echos and will open access application, it just wont find the file. When run directly by double clicking on the batch file on the client computer it does exactly the same, but it does find the file and opens the .mdb as expected.

I just can't understand why there is any difference
0
Bill PrewCommented:
When you run the bat file locally (not via PSEXEC) what user are you logged in as on the local machine?  Is it the same user in the domain that you are using when you run it remotely via PSEXEC?  If not then you may be running as some other user like GUEST on the remote computer that doesn't have access to the share location.  There are command line parms in PSEXEC that allow specification of the user id and password to execute on the remote system.

~bp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

daz84Author Commented:
That could well be the solution! I have been logged on to client PC as admin, although all users should have access to shared folder. I will give the -u -p params a try
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
If that doesn't work try this:

"\\mySserver\myDirectory\myDatabase.mdb /cmd  myParameter"
0
daz84Author Commented:
Thanks for your efforts, neither of those solutions proved to be the case though

I am positive it is something to do with permissions but I can't find anything else to set!

It's gonna be a long night for me, this is meant to be going live tomorrow :(
0
Steve KnightIT ConsultancyCommented:
not on a pc now to advise syntax but may be worth seeing if schtasks or at command set to run asap would give you what you need at all?
0
daz84Author Commented:
Sorry, I'm not sure what you mean?
0
Steve KnightIT ConsultancyCommented:
instead of using psexec i meant.  you can run schtasks or at to schedule a job to run on a remote pc from commandline too.

Schtasks /? Or at /? From a cmd.exe prompt will give you the syntax or will  suggest when i can later.
0
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
I guess we are now in need of debugging. If you think it is worth the effort:
* download ProcMon (http://technet.microsoft.com/de-de/sysinternals/bb896645),
* run it on a client,
* set a filter "Path", "contains", "\\mySserver",
* and start the file the way it does NOT work.
As soon as you get nothing (or the error), press the "magnifier glass" to stop capturing.
You might see a lot of lines - but most interesting is any failure, in particular if it is not followed by success for the same path or file.
If you want to quick-jump to a path contained in the log, select the line, and press Ctrl-J.
0
Steve KnightIT ConsultancyCommented:
Debugging is a good plan, a quick google showed the commandline options of schtasks here:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/schtasks.mspx?mfr=true

e.g.

schtasks /create /tn My Task /tr "C:\myDirectory\myBatch.bat" /sc ONLOGON /s PCNAME

to start your batch each time someone logs on to the computer

or you could AT:

at \\computer /interactive hh:mm "yourcommand.cmd"

Steve
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
As stated earlier:

Did you check the permissions on the SERVER folder hosting the database? In order for users to run the database they'll need at least Modify permissions on that folder (most times you would provide Full permissions). Users must be able to create/destroy files in that location (Access creates/destroys locking files when a database is run).
0
daz84Author Commented:
Still got nothing working on this, had a network engineer out for three hours and still no luck. Going on-site today and will possibly be looking at workarounds involving copying tables out of the back end onto the client and passing the changes back, rather than opening the actual database on the server
0
daz84Author Commented:
I'm going to close this now and award points to those who have been helpful and offered good suggestions. I will pass on any information I can if/when I get this solved.
0
daz84Author Commented:
Solution to this particular problem not found, but useful hints supplied for future reference
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.