Run From Command Line Question

J

Jeff C

The following events are tied to an OnClick Event of a command button.

DoCmd.SetWarnings False

Set oShell = CreateObject("WScript.Shell")
oShell.Run """C:\Program Files\Mobius\DocuAnalyzer\Program\Autoscrp.exe""
""s:\Analyzer\eMAR.bat""", 0, True


DoCmd.TransferText acImportFixed, "rpt11Import", "ScannedTBL", "s:\Rpt11.txt"
DoCmd.OpenQuery "qry_Clean1"
DoCmd.OpenQuery "qry_Clean2SpacesTime"
DoCmd.OpenQuery "qry_Clean3Add0"
DoCmd.OpenQuery "qry_Clean4MakeFourDigit"
DoCmd.OpenQuery "qry_Clean5Add:"
DoCmd.OpenQuery "qry_Clean6UpdateMidnight"
DoCmd.OpenQuery "qry_Clean7CombineDateTime"
DoCmd.OpenQuery "qry_Clean8AppendNewData"
DoCmd.OpenQuery "qry_Clean9DeleteTempImport"
DoCmd.DeleteObject acTable, "Rpt11_ImportErrors"

DoCmd.SetWarnings True

I want to schedule these to run at a certain time every night using the Task
scheduler and I don't know how to go about it. I think there must be an
easier way than converting allthese VB commands to WSH.

What would be the best way to do this? Thank you
 
J

John W. Vinson

I want to schedule these to run at a certain time every night using the Task
scheduler and I don't know how to go about it. I think there must be an
easier way than converting allthese VB commands to WSH.

Create a Macro named, say, RunJob. In the Scheduler launch your database with
a command line switch:

"C:\yadayada\msaccess.exe" "E:\somepath\my.mdb" /x RunJob

John W. Vinson [MVP]
 
L

Long Live Aaron Kempf

Warning!

John Vinson is a known troll; he does nothing but run around promoting MDB

I would reccomend finding a credible SQL Server developer / dba in order to
suit your needs.
 
T

Tom Wickerqueer

just use SQL Server and SQL Agent

this funcitonality is built in to a freeware version of SQL Server, why
would you do ANYTHING from the command line?
 
J

Jeff C

I have never used SQL Server or SQL Agent, I should probably get a hold of
those pprograms and start learning them.

As I said initially, I want to run certain sequences on a schedule. The
particular database I was using is very heavy with numerous reports. As we
know, reports in Access take up a lot of space, for me anyway they account
for the bulk (80%) of the size of the database. For some reason this was
what was causing the problem with running a macro from the command line or
script.

My workaround was to create a new empty database and import the data, I then
imported the specific action queries. The database with all the reports
accounting for the bulk of the size I then linked to the new data in the new
database. This has worked. Certain reports are printing to multiple
printers on a schedule, the new data is imported and manipulated on a
schedule, and my hands-on time has dropped to nearly zero.

The idea of running things from a command line had the sole purpose of
allowing me to run the tasks in the scheduler. Is there another method?
 
B

BruceM

Ignore everything from Long Live Aaron Kempf and Wickerqueer. His mission
is to bash Access and those who offer their help. SQL Server has it uses,
but will not affect reports and other front-end features.
 
D

David W. Fenton

I have never used SQL Server or SQL Agent, I should probably get a
hold of those pprograms and start learning them.

No, don't bother. The person who "answered" your question is a known
troll with no actual knowledge or skills whose answer to everything
is SQL Server and ADP, even when it is completely irrelevant. Just
ignore it.
 

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

Top