[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Batch running of Access

Posted on 2014-03-19
9
Medium Priority
?
350 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 39

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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 

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 39

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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…

649 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