Topics Search

Running a query / macro through scheduled task

Running a query / macro through scheduled task
Views: 283
I have a MS Access append query that updates a table from a linked Excel spreadsheet.
I'm trying to automate the running of the query during the night.

I've tried a couple of ways to schedule the task with Windows Task Scheduler, although each time, it appears to start the job, but then just hang (task never completes, doesn't run the queryor macro and when I log back into Windows, the msaccess.exe process is running).

Methods I've used are:
Sponsored Links:

More topics

 

Task scheduled to execute macro?

Preview
I heard its possible to create a windows scheduled task to execute a macro in a db at a specific time? Can someone explain how to do this?
 

Why my macro cant close the Access

Preview
I have maded a simple macro which completes query which makes a new table. After that the macro saves the changes and closes the Access. Everythig works fine when I complete the macro from the desktop icon.

But when I try to complete the macro from Windows scheduled task (in every three minutes) the macro cant close the Access. Macro completes the query fine but then it says that it cant close the Access because of some module uses OLE or DDE. (I have not ever made any modules in my database) And after that Access claims that Access try to complete DoCmd object and you choose cancel. So what does that mean?
I have only maded a simple macro which runs query and close the Access so why it claims like that? And why the macro works when I starts it myself (from desktop icon)? So how I can get my macro to work from Windows scheduled task
 

Create an Outlook task for an Access macro

Preview
I have an Access macro that runs a function to run a query and export it to my C: drive as an excel spreadsheet. I would like to have a task on my outlook to run this macro. It is not scheduled, it needs to be able to be run on demand.

I know I can create the outlook task from a Saved Export, this macro also has to run the query that has a user inputted date parameter.
 

Need to automatically close Access

Preview
I have a Microsoft scheduled task to open MS Access, and my DB, and run a macro that runs a query, and updates a table several times a day. This is on an unattended computer that runs 24X7. The problem I am having is getting Access to close. I can close the access DB via the macro, but can't seem to get anything to work to close Access itself. Since access is not closing - the schedular still shows my job as running, and will not run at the next scheduled time. I have seen referances to Application.Quit and DoCmd.Quit, but I can't get them to work in my macro in my Access DB (I have fair Access knowledge, but no VB knowledge, and haven't worked with macros very much
 

Error 2950 In A2007 in AutoExec Macro From Trusted Location

Preview
I'm running Access 2007 on a Win XP box. I have a make table query to create a local table from linked Oracle tables. I have been running this successfully for a couple months in a trusted location from an AutoExec macro via a scheduled overnight job.

I recently started receiving a 2950 error when running the query from the macro, but when I run it manually itcompletes successfully.
 

Macro sending report twice instead of once

Preview
I have a macro which sends a report from Access, I used the Scheduled task to run the macro on a specific time everday. I Placed the below code in the Timer() Event of the main form. the macro is running fine but the reports are being sent twice.?

Static intCounter As Integer
Private Sub Form_Timer()
If intCounter > 1 Then
Me.TimerInterval = 0
DoCmd.Quit
Else
DoCmd.RunMacro "mcrTest"
End If

intCounter = intCounter | 1
End Sub
 

Macro Sequence

Preview
When a macro runs, does it wait for the previous step to finish before beginning the next? In one macro I have it runs a query that takes a little time to run due to the large number of records. I want to close the database when the macro is finished running (this is an automated task that runs when I am not here) but I don't want to add this step if it is going to try to close in the middle of running the query
 

Task Scheduler using Service Account

Preview
Just hoping someone has handled setting up a Scheduled Task using Service Account (with no interactive login capabilities) credential to run an Access Database.

System:
Access 2003 SP2
Windows Server 2003, Standard Edition
Certificates are not being used

Using Task Scheduler to run an Access database macro with my credentials poses no problem, once the security is set low.

SA is a network domain service account beloging to the Local Admin group on the server. The account does not have interactive log in capabilities. To test, HKLM had the missing security key created (Level) with a value of 1 (low). The jet key "Sandbox" already existed and had a value of 2.

When the scheduled task runs the database fails to open, which suggests there is still a pop-up (macro security?) window waiting for a response.

PS. If anyone doesn't know how to schedule a database open a thread and I will show you one (cheap way) to set it up
 

Executing Access macro

Preview
I execute an access macro from a batch file. I use this command:

"C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE" file.mdb /x Import /nostartup

The macro is executed correctly but I see always that access window starts, even if I use /nostartup command. How is possible?

the second problem is about what happens when the macro gives an error.
I would like that in every case msaccess process is killed. This macro is scheduled in windows task, so every morning when I open task manager, I see a lot of msaccess.exe processes.

So I would like to know how to force the killing of access process when the work is ok but also when it's not ok. Now I use the "Quit" command inside macro. I see also a lot of other commands but I don't know which is better to use

last thing: is it possible to wite the result of the macro executed by access in a log file? If not how can I know if the macro is ok or not
 

Access scheduled task

Preview
Anyway to set it up so an access application will run as a scheduled task while logged off? The task is set to run even when the user is logged off. When I try and I log-off it wont run it