Windows 10, Access 2016
If I run the Batch file directly (double click) it works, if it is started by a Scheduled Task it fails - just stops running with no obvious Event Error
The batch command is: "C:\Program Files\Microsoft Office\Office16\MSAccess.exe" "C:\Local Shared Folders\Access FE\Create_Client_List_Stub.accdb"
The stub (test) Access database opens a linked table on the C drive but fails when it tries to open a linked table on a network drive (Windows 2012 R2)
The network folder and backend database have Security set for Everyone full access
Access Code:
Public Function Start()
DoCmd.SetWarnings False
DoCmd.OpenQuery "LogTime_1"
DoCmd.SetWarnings True
Set CurrentDatabase = CurrentDb()
DoCmd.SetWarnings False
DoCmd.OpenQuery "Log_2"
DoCmd.SetWarnings True
' Setup variables for table to contain extracted Client information
Set ClientExtractTable = CurrentDatabase.OpenRecordset("Client_List")
Set ExtractID = ClientExtractTable.Fields("Client_ID")
Set ExtractLastName = ClientExtractTable.Fields("Client_Last_Name")
Set ExtractFirstName = ClientExtractTable.Fields("Client_First_Name")
Set ExtractAddress = ClientExtractTable.Fields("Client_Address")
DoCmd.SetWarnings False
DoCmd.OpenQuery "Log_3"
DoCmd.SetWarnings True
/Code
There is an AutoExec Macro which executes the Start function
The queries update a log table (linked table on the C Drive) to identify where the processing stops - the last entry is 2, before the OpenRecordset command
I asked this question on the Microsoft Access forum but did not receive an answer