Scheduled Task not starting MS-Access

After a PC rebuild (new Windows and applications install), a batch file step, started by a scheduled task has suddenly failed to execute properly.  The scheduled task normally runs at night when the user is logged off.

A PC printer problem prompted a network admin to reinstall OS and applications on client PC.  The schedued task was copied from old system to post-rebuild system.  As part of my diagnosis and attempt to fix the problem, I deleted and created a new (identical) scheduled task.

The batch file step that fails starts MS-Access97 and starts a macro in the database.

When the batch file is launched from Windows Explorer, it runs correctly.
When the scheduled task is run manually, the batch file runs correctly.

I've checked the security permissions for the msaccess.exe and the database being opened.  They match the security credentials of the scheduled task.  The scheduled task user credential is a local admin.

I've added enough logging to the batch file that I can see the early steps, executing JetComp, run successfully.  I know that the msaccess.exe and database are visible to the batch file.

The OS version is WinXP.
LVL 46
aikimarkAsked:
Who is Participating?
 
aikimarkConnect With a Mentor Author Commented:
I supervised the network admin uninstall and install Access97 and Office2003 yesterday.  The batch files, kicked off by the scheduled tasks, ran successfully.  Yeah!
 
0
 
Jim P.Connect With a Mentor Commented:
What userid is in the scheduled task box?

Are there any events in the security or system log around the time of the auto launch?
0
 
aikimarkAuthor Commented:
>>What userid is in the scheduled task box?
OAdomainname\userid

I've also tried
username@OAdomainname.URIdomainname

>>security or system log
I'll check on that.  Thanks.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Jim P.Connect With a Mentor Commented:
Does the OAdomainname\userid belong to the Administrators group on the PC?
0
 
aikimarkAuthor Commented:
it should.  the network admin said that he was a local admin.  I'll check that group to verify.
0
 
Jim P.Commented:
Another thing to check if is seetto run even if not logged in?
0
 
Jim P.Commented:
Another thing to check if is seetto run even if not logged in?
0
 
aikimarkAuthor Commented:
@jim

Yes.  The settings are run if not logged in and to wake up the system, ignoring any battery/power savings mode.  The scheduled task does run, it is just the msaccess.exe step that fails.  Since the step runs if the user is logged on, I'm at a loss for how to diagnose the step failure.
0
 
Jim P.Commented:
Can you post the contents of the bach file?
0
 
aikimarkAuthor Commented:
Just checked and found
1. no events (system, application, security, OS, etc.) related to the batch file or scheduled task

2. the user is in the administration group.
0
 
Jim P.Commented:
Can we se the bath?
0
 
aikimarkAuthor Commented:
This is the complete batch file, including the diagnostic logging statements.

The failure is occurring about 2/3 down the batch file at:
"C:\Program Files\MS Access\Office\MSAccess.exe" "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\Patscan.mdb" /x ConsolidateData
echo RunJetComp.CMD:::Begin >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
date /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
time /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

rem pause start of :JC_70124

:JC_70124

del "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR70124W\JC_Patscan.mdb" 
\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\jetcomp.exe -src:"\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR70124W\patscan.mdb" -dest:"\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR70124W\JC_Patscan.mdb" -v3 >> "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt"
If Errorlevel 1 goto JC_70316
del "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR70124W\patscan_Bkup.mdb"
ren "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR70124W\patscan.mdb" patscan_Bkup.mdb
ren "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR70124W\JC_Patscan.mdb" "patscan.mdb"

rem pause good end of :JC_70124
echo good end of :JC_70124 >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
date /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
time /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

:JC_70316

rem pause start of :JC_70316


del "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR70316W\JC_Patscan.mdb"
\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\jetcomp.exe -src:"\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR70316W\patscan.mdb" -dest:"\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR70316W\JC_Patscan.mdb" -v3 >> "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt"
If Errorlevel 1 goto JC_71047
del "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR70316W\patscan_Bkup.mdb"
ren "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR70316W\patscan.mdb" patscan_Bkup.mdb
ren "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR70316W\JC_Patscan.mdb" "patscan.mdb"

rem pause good end of :JC_70316
echo good end of :JC_70316 >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
date /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
time /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

:JC_71047

rem pause start of :JC_71047

del "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR71047W\JC_Patscan.mdb"
\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\jetcomp.exe -src:"\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR71047W\patscan.mdb" -dest:"\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR71047W\JC_Patscan.mdb" -v3 >> "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt"
If Errorlevel 1 goto JC_82364
del "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR71047W\patscan_Bkup.mdb"
ren "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR71047W\patscan.mdb" patscan_Bkup.mdb
ren "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR71047W\JC_Patscan.mdb" "patscan.mdb"

rem pause good end of :JC_71047
echo good end of :JC_71047 >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
date /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
time /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

:JC_82364

rem pause start of :JC_82364

del "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR82364A\JC_Patscan.mdb"
\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\jetcomp.exe -src:"\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR82364A\patscan.mdb" -dest:"\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR82364A\JC_Patscan.mdb" -v3 >> "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt"
If Errorlevel 1 goto JC_Exit
del "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR82364A\patscan_Bkup.mdb"
ren "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR82364A\patscan.mdb" patscan_Bkup.mdb
ren "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\QDR82364A\JC_Patscan.mdb" "patscan.mdb"

rem pause good end of :JC_82364
echo good end of :JC_82364 >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
date /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
time /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

rem pause start nightly consolidation
echo consolidation steps:::Begin >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
date /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
time /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

dir "C:\Program Files\MS Access\Office\MSAccess.exe" >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
dir "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\Patscan.mdb" >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

"C:\Program Files\MS Access\Office\MSAccess.exe" "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\Patscan.mdb" /x ConsolidateData

echo end data consolidation >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
date /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
time /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

del "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\JC_Patscan.mdb"
\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\jetcomp.exe -src:"\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\patscan.mdb" -dest:"\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\JC_Patscan.mdb" -v3 >> "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt"
If Errorlevel 1 goto JC_Interp
del "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\patscan_Bkup.mdb"
ren "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\patscan.mdb" patscan_Bkup.mdb
ren "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\JC_Patscan.mdb" "patscan.mdb"

echo good end consolidated database Repair and Compact >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
date /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
time /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

:JC_Interp
del "\\midway\hologic$\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\JC_Interpretations.mdb"
\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\jetcomp.exe -src:"\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\Interpretations.mdb" -dest:"\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\JC_Interpretations.mdb" -v3 >> "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt"
If Errorlevel 1 goto JC_Research
del "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\Interpretations_Bkup.mdb"
ren "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\Interpretations.mdb" Interpretations_Bkup.mdb
ren "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\ConsolidatedScannerDataAndInterpretations\JC_Interpretations.mdb" "Interpretations.mdb"

echo good end interpretations database Repair and Compact >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
date /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
time /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

:JC_Research
rem pause start research database Repair and Compact
del "\\midway\hologic$\JC_Research.mdb"
\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\jetcomp.exe -src:"\\midway\hologic$\Research.mdb" -dest:"\\midway\hologic$\JC_Research.mdb" -v3 >> "\\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt"
If Errorlevel 1 goto JC_Exit
del "\\midway\hologic$\Research_Bkup.mdb"
ren "\\midway\hologic$\Research.mdb" Research_Bkup.mdb
ren "\\midway\hologic$\JC_Research.mdb" "Research.mdb"

echo good end research database Repair and Compact >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
date /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
time /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

:JC_Exit

echo attempt to rename stop.flg.old >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
date /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
time /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

dir "\\midway\hologic$\stop*" >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

ren "\\midway\hologic$\stop.flg" "stop.flg.old"

echo after rename stop.flg >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
dir "\\midway\hologic$\stop*" >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

echo end of consolidation steps >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
date /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt
time /t >> \\midway\hologic$\Nightly_Patscan_Copies_From_Scanners\JC_Log.txt

rem pause before exit

exit

Open in new window

0
 
ldunscombeConnect With a Mentor Commented:
If the database relys on links to a backend database via a "mapped network drive" this could explain why it would work if the user is logged on and not when they are not.

I am not a networking expert but if this is the case then you may be able to add a NetUse command in your batch file to map the required drives prior to executing the db.

Just some food for thought.

Leigh
0
 
Jim P.Commented:
<Click!>

It worked before, but not after -- so the authentication from the Computer to the Domain has probably changed.

You're going to a hidden share via UNC, so the drive mapping doesn't matter.

But this is confusing because you are using the OAdomainname\userid which if you login should be able to see the path.
0
 
ldunscombeCommented:
jimpen

The batch file is using a UNC path and seems to be working up until opening the database file which would suggest that the authentication is OK.  While the batch file is using a UNC path the same is not necessarily so for the linked tables within the db itself.  If a table is linked via ODBC through a mapped drive that doesn't exist / hasn't been mapped you will get problems.

Just a possibility.

Leigh
0
 
aikimarkAuthor Commented:
My next step will be to have the network admin uninstall both Office2003 and Access97 and install them (and service patches) in their original order.
0
 
ldunscombeCommented:
While your at it get hime to check any ODBC connections that the DB may be using and to make sure they are system DSN's and not User DSN's

Leigh
0
 
aikimarkAuthor Commented:
thanks.  will do.
0
 
aikimarkAuthor Commented:
Thanks for participating in the thread.  I have no idea why the rebuilt PC software configuration did not work.
0
All Courses

From novice to tech pro — start learning today.