?
Solved

Batch running of Access

Posted on 2014-03-19
9
Medium Priority
?
349 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 38

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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

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 38

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Suggested Courses

762 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