How do i create automated scripts?

G

goose220

I am trying to create a script that runs every night at a certain time. This
script is supposed to remove all of the items that are older than 6 months
from one table I have into another.
 
D

dlw

set it up in delete query with an autoexec macro to run it. Use control
panel / scheduled tasks to schedule access to run.
 
R

Roger Carlson

Actually, I would modify this advice just a little. Instead of putting the
delete query in the AutoExec macro, I would put it in a regular macro. I
would still create a scheduled task, but I would add the /x switch to the
command line.

The /x switch will execute any macro of your choosing when opening the
database. The command line might look something like this:

C:\Program Files\Microsoft Office\Office\MSACCESS.EXE
C:\Library97\RemoteMacro.mdb /xAutoRun

In this case, I called the macro "AutoRun" and the database is called
"RemoteMacro.mdb"

On my website (www.rogersaccesslibrary.com) you can find the
"RemoteMacro.mdb" sample which illustrates this. It's in A97 only, but you
can convert it.

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
T

Tatakau

I tried to create a scheduled task in windows to run a database macro, but I
cannot get it to work. The command line that I am trying to run is:

"M:\Access Files\PrototypeDS.mdb /xDailyReport"

and the 'Start in' field is set to the MS Access directory:

"C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Office"

If I run the line "M:\Access Files\PrototypeDS.mdb" (no switch operation)
the database will open, but with the /xDailyReport switch, the macro will not
run. Any suggestions?

Thanks,

Nick
 
D

Douglas J. Steele

Your shortcut needs to include the full path to the Access executable,
msaccess.exe

C:\Program Files\Office\Msaccess.exe M:\Access Files\PrototypeDS.mdb
/xDailyReport
 
Top