C
css
This may not be the correct community to post, so please let me know if I
should post elsewhere.
We're running Server 2003 & I'm having issues with Access starting from a
batch file.
The batch file executes daily. It copies the front end to the Scheduled
directory, then executes access & runs a macro that calls a vba function. I
have both the batch file & the vba function writing to a log file so I know
what's been going on overnight. Most days all runs fine. However, some times
the batch file just hangs. When I check the server in the morning, Scheduled
Tasks says the daily batch is running. Task Manager shows MSAccess.exe is
running, although it's not open & running on the screen. I stop the scheduled
task, end the process tree for MSAccess, then can restart the scheduled task
and all is fine.
Here's the code from the batch file:
rem log copy
echo OnRentFE.mdb copy has started %Date% %Time% >> "D:\Shared
Folders\MSAccess\Scheduled\results.log"
rem copy
xcopy "D:\Shared Folders\MSAccess\FE\Invtry\OnRentFE.mdb" "D:\Shared
Folders\MSAccess\Scheduled\OnRentFE.mdb" /y
rem log error
echo OnRentFE.mdb copy error level was %errorlevel% %Date% %Time% >>
"D:\Shared Folders\MSAccess\Scheduled\results.log"
rem log Access start
echo Items Returned report has started %Date% %Time% >> "D:\Shared
Folders\MSAccess\Scheduled\results.log"
rem start db
"c:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "D:\Shared
Folders\MSAccess\Scheduled\OnRentFE.mdb" /wrkgrp "D:\Shared
Folders\MSAccess\VRwrkgrp.mdw" /user Schedule /pwd schedule /X YestOR
rem log Access done
echo Items Returned report error level was %errorlevel% %Date% %Time% >>
"D:\Shared Folders\MSAccess\Scheduled\results.log"
My log file will show the copy started & completed with an error 0. Also it
will show that the Items Returned report has started.
The YestOR macro calls a public function. The first thing the function does
is write a line to the batch file also. This doesn't happen. Here's the code:
Open "D:\Shared Folders\MSAccess\Scheduled\results.log" For Append As #1
'open results.log
str = " OnRentFE.mdb - Start Items Returned report - pull data " & Now
Print #1, str
Close #1
Again, it works fine when I log on to the server & tell Scheduler to run it.
But not overnight. I try to make sure I log the administrator off the server,
but sometimes it'll just time out & lock the server. Originally, the code was
set using mapped drive s: instead of c: & d:. I thought it might have to do
with using the mapped drive, but I just don't know where else to look.
Thanks,
Connie
should post elsewhere.
We're running Server 2003 & I'm having issues with Access starting from a
batch file.
The batch file executes daily. It copies the front end to the Scheduled
directory, then executes access & runs a macro that calls a vba function. I
have both the batch file & the vba function writing to a log file so I know
what's been going on overnight. Most days all runs fine. However, some times
the batch file just hangs. When I check the server in the morning, Scheduled
Tasks says the daily batch is running. Task Manager shows MSAccess.exe is
running, although it's not open & running on the screen. I stop the scheduled
task, end the process tree for MSAccess, then can restart the scheduled task
and all is fine.
Here's the code from the batch file:
rem log copy
echo OnRentFE.mdb copy has started %Date% %Time% >> "D:\Shared
Folders\MSAccess\Scheduled\results.log"
rem copy
xcopy "D:\Shared Folders\MSAccess\FE\Invtry\OnRentFE.mdb" "D:\Shared
Folders\MSAccess\Scheduled\OnRentFE.mdb" /y
rem log error
echo OnRentFE.mdb copy error level was %errorlevel% %Date% %Time% >>
"D:\Shared Folders\MSAccess\Scheduled\results.log"
rem log Access start
echo Items Returned report has started %Date% %Time% >> "D:\Shared
Folders\MSAccess\Scheduled\results.log"
rem start db
"c:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "D:\Shared
Folders\MSAccess\Scheduled\OnRentFE.mdb" /wrkgrp "D:\Shared
Folders\MSAccess\VRwrkgrp.mdw" /user Schedule /pwd schedule /X YestOR
rem log Access done
echo Items Returned report error level was %errorlevel% %Date% %Time% >>
"D:\Shared Folders\MSAccess\Scheduled\results.log"
My log file will show the copy started & completed with an error 0. Also it
will show that the Items Returned report has started.
The YestOR macro calls a public function. The first thing the function does
is write a line to the batch file also. This doesn't happen. Here's the code:
Open "D:\Shared Folders\MSAccess\Scheduled\results.log" For Append As #1
'open results.log
str = " OnRentFE.mdb - Start Items Returned report - pull data " & Now
Print #1, str
Close #1
Again, it works fine when I log on to the server & tell Scheduler to run it.
But not overnight. I try to make sure I log the administrator off the server,
but sometimes it'll just time out & lock the server. Originally, the code was
set using mapped drive s: instead of c: & d:. I thought it might have to do
with using the mapped drive, but I just don't know where else to look.
Thanks,
Connie