Hello all,
Getting stuck again on trying something new. I have few action queries which updates TblUsers based on imported table from HR data to addnew users and update current users. I put this action query in a VBA module(ActiveListSync) and attempting to run a VB Script to run the module without having to open Access. (Want to schedule the script with windows task to run it everyday at certain time) Every time I run a script it gives me an error. (see attached)
Error: "MS Access can't open the database because it its missing, or opended exclusively by another user, or it is not an ADP file.
Code: 800A1EBA
Here it code for module
VB script
Getting stuck again on trying something new. I have few action queries which updates TblUsers based on imported table from HR data to addnew users and update current users. I put this action query in a VBA module(ActiveListSync) and attempting to run a VB Script to run the module without having to open Access. (Want to schedule the script with windows task to run it everyday at certain time) Every time I run a script it gives me an error. (see attached)
Error: "MS Access can't open the database because it its missing, or opended exclusively by another user, or it is not an ADP file.
Code: 800A1EBA
Here it code for module
Code:
Public Sub Sync()
'Running active List Sync to update users table
Dim dbs As DAO.Database
Set dbs = CurrentDb
dbs.Execute "QryAppendUsers", dbFailOnError
dbs.Execute "QryAutoUpdtUsrs", dbFailOnError
dbs.Execute "QryUpdtUsrsDeact", dbFailOnError
dbs.Execute "QryUpdtCarDeact", dbFailOnError
End Sub
VB script
Code:
dim accessApp
set accessApp = createObject("Access.Application")
accessApp.visible = False
accessApp.OpenCurrentDataBase("\\hwhr-fs-01\Root Data 01\Data\ParkingPermit\Test.mdb")
accessApp.Run "ActiveListSync"
set accessApp = Nothing