[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Batch running of Access

Posted on 2014-03-19
9
Medium Priority
?
351 Views
Last Modified: 2014-03-20
I have been having a lot of issues getting a windows scheduled process to work properly on a remote server.

The process worked for years. Effectively what it does is update one table in an Access database using a csv file; that table is linked to a Quick Books database table. Then it exports the contents of three Quick Books tables (all linked to MS Access) to csv files.

All this is initiated from a .bat file, with is command:

"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE" "C:\C_LSS\DB\Linked_to_LSS.mdb"  /x "LSS_MACR_Mo-1"

I realized today that in using GotoMyPC to access the remote computer, that I have been leaving Access OPEN in that computer overnight when the scheduled process runs.

When I look in the morning, Access is open & it is asking if I want to update a table, etc. Of course, I want all that to run transparently overnight.

Can I be causing issues by leaving Access "open" on the remote machine?

Thanks
0
Comment
Question by:Richard Korts
  • 4
  • 3
  • 2
9 Comments
 
LVL 28

Accepted Solution

by:
omgang earned 1000 total points
ID: 39940383
In my experience launching an Access macro via Scheduled Task spawns a new Access process on the machine.  When you leave Access open are you leaving the same db open?  E.g. are you accessing Linked_to_LSS.mdb during your GoToMyPC sessions and leaving it open?
OM Gang
0
 
LVL 28

Expert Comment

by:omgang
ID: 39940391
...and do you have Warnings turned off in the Macro or in any procedures that are called from the Macro?
OM Gang
0
 
LVL 40

Expert Comment

by:PatHartman
ID: 39940539
Your macro needs to explicitly close Access as the last step.  It also needs to turn warnings off so you don't get any notification messages.

Leaving Access open this way could interfere with the ability of other users to open objects in design view.  It could cause other update conflicts depending on what task Access is running.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Richard Korts
ID: 39943127
How do I turn warnings off in the Marco (& queries it runs)?

How do I close Access at the end?
0
 
LVL 28

Expert Comment

by:omgang
ID: 39943174
Access 2010?  In Macro design, click on the Show All Action ribbon option.
Now, you should see SetWarnings as an available option in the list of Actions.
SetWarnings No   <-- turns warnings off
SetWarnings Yes  <-- turns warning on

You'll also see an action named
QuitAccess

Make sure that's the last action in your macro as it will close the db and exit the Access application.

OM Gang
0
 
LVL 40

Assisted Solution

by:PatHartman
PatHartman earned 1000 total points
ID: 39943581
Even though this macro runs unattended I like to always include a line that sets the hourglass on whenever I set warnings off.  This is a visual clue to me should the macro stop for some reason that the warnings are still off.  I have two macros in every application (in most apps, they are the ONLY macros).  One to set warnings off and the hourglass on and the second to do the opposite.  This gives me an easy way to modify the settings.

I do this because leaving warnings off is deadly dangerous when you are developing.  If you close some object without explicitly saving it, Access will silently discard your changes.  Bye-bye 4 hours of work.  With warnings on, Access will prompt you when you close an object to remind you to save when you have changed it.
0
 

Author Comment

by:Richard Korts
ID: 39943674
I understand both of your inputs.

As I said in the posting, a slightly different version of this Macro has been running, unattended, every night, for about 6 years.

No problems.

So I don't know what to do.
0
 
LVL 28

Expert Comment

by:omgang
ID: 39943688
I don't think you answered my question from yesterday.

.....When you leave Access open are you leaving the same db open?  E.g. are you accessing Linked_to_LSS.mdb during your GoToMyPC sessions and leaving it open?

OM Gang
0
 

Author Comment

by:Richard Korts
ID: 39943728
I just discovered the original macro HAS SetWarnings No.

So I'm going with that on this one; see what happens tonight.

Thanks
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question