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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

varbatchfile - not working with Access 2003!

Status
Not open for further replies.

Techniproshop

Programmer
Apr 24, 2007
50
0
0
CA
Hi all. I was using a batch file to update a new version of my access database and the script I was using under Win2k and Office 2000 was: varBatchFile = Shell("M:\04 - Adjudanterie\01 - Interne partagé\BAB\SGAD\Installation\Install_SGAD.bat", 1)

When I was opening my database and a new version was available, the database was calling the batch file and shutting down to reopen the new updated version. The batch file is still working if I run it manually (double click on) but my shell command doesn't work. The black window appears for 1 seconde and close right away without copying the new version of my database. It looks like the path name isn't valid for Access 2003 but this is the good one so I don't know what to do. Is there anything to do with Win XP or Access (Office) 2003?

Thanks so much for any help you can provide.
 
Put "Pause" at the end of the batch file and see what error message you are getting.

Mike
 
Mike, I did the pause and I get the message "file not found"
Everything was fine with Win2k but with XP, it's not working. Here is the code:


XCOPY "M:\04 - Adjudanterie\01 - Interne partagé\BAB\SGAD\Instal\*" c:\ /h /y /s

I want everything in my Instal folder to be copied on the C:
Because there is spaces and folder names over 6 char in the address, I use quotes.

any clue?
 
If I run the batch file manually, it works but when the database call it, I got the "File not found" message. Why is it working in the first case and not the second? So frustrating!
 
For what it is worth, the batch file I use looks like the below. My module uses a message box to say there is going to be an update. Also I am not sure which forum but there is a FAQ posting with an alternate method for upgrading. Mine works so I never tried it.


Code:
@echo Off
echo Yes this is the mysterious Dos window previously alluded to.
echo After Access Closes (wait until it is no longer on the taskbar),
Pause
echo Upgrade in progress please wait patiently.

echo ABOUT TO COPY %1 TO %2
copy %1 %2

REM cls
echo Upgrade complete.  You may use the application now.
Pause

echo The title bar (bar at top of window [Default color blue]) 
echo should now say finished.
echo When it does read finished you may close this Dos window.

The only thing that throws me about your syntax is using * instead of *.* but it should run the same from a shell command as it does otherwise.

Perhaps it is giving an erroneous error message if the file is still locked? You might try running your shell statment from another database file to find out.

I hate to ask the obvious but is the same user logged in to run the batch file manually as well as when it is run by Access? If not it could be permissions.
 
I suspect that the file not found is the batch file.

I would move the file temporarily to the

M:\Install_SGAD.bat

dirctory and change your shell command, just to see if it works.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top