How do i create automated scripts?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
set it up in delete query with an autoexec macro to run it. Use control
panel / scheduled tasks to schedule access to run.
 
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top