Re: run an Access query from windows scheduler



sumGirl wrote:
Is it possible to run an access query from the scheduler? I need to
update a table in the middle of the night, and so I would like to set
up a job on a machine thats on all night so I dont have to manually do
it.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

An easy way is to create a shortcut to the query (just right-click the
query in the DB window & drag to the desktop). Then set up the
scheduler to run the shortcut. After the query runs Access will remain
open until you give a command to close it or someone manually closes it.

If you want more control you can set up a routine or macro in the Access
file. Use a batch file (.bat) w/ a command line like this (all one
line):

"c:\program files\microsoft office\office10\msaccess.exe"
"c:\MyDatabase.mdb" /x MyMacroName

exit

The command line switch /x means run the macro named after the switch.

To get a VBA routine to run use the /cmd option. Then you have to use
VBA's Command function to retrieve the cmd & run it. See the Access VBA
help topic "Command Function" for more info.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRCxqV4echKqOuFEgEQKkJQCfdx1SAcDp3PEyWVXpC1Kyn5dtmqQAoMtF
1I2BkeawN4g4bVFmq5IOOd2o
=svAF
-----END PGP SIGNATURE-----
.



Relevant Pages

  • Re: Counting Concurrent timed events
    ... When you make a command button, Access gives it an ambiguous name like "Command2" ... ... then compile your code ... Exit Sub ... what you need to be able to do is replace the SQL using a different date before you run the query that uses it. ...
    (microsoft.public.access.queries)
  • Re: Multiple table in dataset query
    ... If a row is marked as Modified, it will run your query defined in the ... Update Command object. ... Dim UpdateStaffCmd As New OleDb.OleDbCommand ... Private Sub frmStaff_Load(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Complex form popup problem: warning...longwinded
    ... command button that launched the other form. ... main form that allows the user to fill out the scenario information, ... The majority of the fields in the query that are the recordsource of the ... remainder belong to the new record that was programmatically saved. ...
    (microsoft.public.access.formscoding)
  • RE: ODBC query in VB code Need HELP
    ... The vb part could be to set up a query string by concatenation or to go ... or call when you press your command button ... the connection string, cursor location, etc. ...
    (microsoft.public.access.formscoding)
  • Re: Query Only Creent Record?
    ... Memos Active, Orders Active, Memos Completed and Orders Completed. ... I tried to build a form called Current Form and a report called Current ... then have the command button on the Current Form to E-mail just that form ... > I would approach this by building a query that refers to that form's ...
    (microsoft.public.access.queries)