0
I'm using Windows Server 8 and I'm having a real problem launching my Access 2010 database from Task Scheduler. As I can see the problem is not new, but I hope, if somebody found a solution, maybe they'd share it with me. This is what I've tried:
- Running with highest privileges,
- List item
- Run when I'm logged on or not,
- I have a Domain Admin permissions,
- The batch file, all folders, sub folders and the database have FULL permissions to my security level;
The task launches a batch file, which is supposed to run the whole thing, and it does if I run it manually. So there is no problem with the code or the script.
What I can see is that the Access file is being created, assuming that the bat file actually launched at least Access object, but id doesn't go any further.
I've also tried the VBScript:
dim accessApp
set accessApp = CreateObject("Access.Application")
' accessApp.visible = True
accessApp.OpenCurrentDataBase("\\...Path to my DB.accdb")
accessApp.Run "NameOfMyFunction"
accessApp.Quit
set accessApp = nothing
No success either! Windows Server 2008 R2 Standard, SP1, 64-bit.
Here is the script from the batch file: echo PROCESS STARTED %date% %time% >>\servername\FolderName\JobLog.txt "C:\Program Files (x86)\Microsoft Office\OFFICE14\msaccess.exe" "\servername\FolderName\DbName.accdb" /x mMacroName
Task Scheduler acts like there is nothing wrong, No error messages, the history shows all steps until "Created Task Process" and doesn't go any further. I see that my database creates a lock file, but the script within the database that writes into the log file doesn't run. The goal here is to activate macro, which runs action queries (DELETE, APPEND ... all that jazz.) and at the end closes the database. As you could see I've added a line in the batch file to write into the log file before launching the database. Not doing it.
Thank you in advance for the time you spend reading this
There's no such thing as "Windows Server 8", so you may want to double check and let us know exactly which version of Windows you are running. Please edit your question and include the code of batch file you are trying to use. And can you give us any more information beyond "Problem launching", "No success" and "it doesn't go any further"? Do you get an error message, or entries in the event log? Does the Task Scheduler think it runs the task successfully? If not, what error code does it report? Where exactly does it get to in the script (add some logging to determine)? – Ƭᴇcʜιᴇ007 – 2014-09-19T15:25:21.010
What is the actual goal here? To run a function inside the Access DB, and exit? – Ƭᴇcʜιᴇ007 – 2014-09-19T15:27:02.837
Please edit new/updated information directly into your question. To confirm, does the date and time actually get logged when the batch is run from the task? Does Access start at all (when you run the batch via the task)? – Ƭᴇcʜιᴇ007 – 2014-09-19T16:41:49.500
Access does not start, batch file does not write into the log file if I start it from the Scheduler. If I run it manually it runs the macro and writes into the log. – detka123 – 2014-09-19T16:50:30.097
tiem to troubleshoot -- Create a bard new task, don't set "Run with highest privileges", set it to urn as your user, and have it trigger a batch file that just echos "blah" (or something) to a file on a drive on your local computer. Run the task, did the file write? If so, change the batch to log the date and time like you have currently. Run task again, does it still work? – Ƭᴇcʜιᴇ007 – 2014-09-19T16:58:21.380
It worked in both cases – detka123 – 2014-09-19T17:24:22.760
Ok, now change the batch to write that file to the share via the UNC path... Does it still work? If so, then your original Task has something configured incorrectly. Often, it's the "run with highest privileges" flag that makes things NOT work. – Ƭᴇcʜιᴇ007 – 2014-09-19T17:26:42.043
It did work again. As of the "Run with highest privileges" option, I tried with and without. Doesn't work either way. I started to think that there might be something to do with permissions but when I check the folder, the database, the batch file - all have Full permissions for Domain Admins. – detka123 – 2014-09-19T17:40:06.500