Account-Related Issue opening Access 2007 from Scheduled Task

Posted on 2012-09-19
Last Modified: 2012-09-29
I am migrating an existing Scheduled Task from a server in one domain to a server in another domain. The servers are both running Windows XP Standard Edition, SP2. I have Active Directory Service accounts, created specifically for the task, in each domain. I also have Microsoft Access 2007 on both servers. The task runs a macro in an Access dbs via a .bat file. The .bat file is essentially as follows:

CD\Program Files\Microsoft Office\Office12
Msaccess.exe "E:\program files\myDBS.mde" /WRKGRP "E:\program files\myDBS.mdw"/x macroName

I can't get the Scheduled Task to run in the new domain with the new service account. If I use MY personal Active Directory account, it runs fine. If I use my Service Account, nothing. I've narrowed it down to my service account not being able to open Microsoft Access. I did this by streamlining the .bat file as follows:

CD\Program Files\Microsoft Office\Office12

My personal account will open Access fine. The service account will not. I also verified that the Service Account WILL run Scheduled Tasks. I wrote a simple .bat file that just changes a file extension, and my Service Account WILL run that Scheduled Task. It just hangs when it tries to open Access.

Another odd thing I've noticed is that on the existing installation, when the Scheduled Task runs, it does NOT visually open Microsoft Access. It seems to run the macro in the background. But on the new server (new domain), when I get the Service to run under my personal account, it physically opens Access, runs the macro, then closes Access. I'm not sure if that's relevant or not so am including it.

My Service Account is an Administrator on the server. It seems to have the same permissions on the server as my personal account. Any ideas? I'm hoping there's a security feature in Access 2007 that I'm missing? Thanks for any help/ideas!
Question by:oneDayAtaTime
    LVL 84

    Assisted Solution

    by:Scott McDaniel (Microsoft Access MVP - EE MVE )
    I suppose it's possible the Service Account is corrupt - have you tried doing this with another Admin-level account?

    Can the service account open other items, like notepad.exe, through the bat file or scheduled tasks? If it can, then there may be issues with the installation of Office/Access on the server. Be sure that you've installed all updates and service packs to Office/Access, as well as to Windows.

    Just a note: You don't need to include the /wrkgrp switch when opening your database, since you're not also including a username/password. Otherwise, this construct:

    Msaccess.exe "E:\program files\myDBS.mde" /WRKGRP "E:\program files\myDBS.mdw"/x macroName

    would simply hang, since Access would try to open with the myDBS.mdw security file, which would presumably require you to log in.

    Accepted Solution

    Thanks for the info, LSMConsulting. I didn't know that about the /wrkgrp switch.

    I figured out my problem. It was a combination of several things.
    1) New installation of Access required my Service Account to enter its name/initials. I had to log onto the server as my Service Account and open Access to get past that annoying pop-up.
    2) New installation of Access required my database location AND the location of Office12 to be added as Trusted Locations in the Trust Center. These settings had to be made logged in as the Service Account user.
    3) Under Access Options (still logged in as my Service Account), made sure new installation of Access had the same settings for "Current Database" as my old setup.
    4) NOW, when I log into the server with my personal account, the Scheduled Task will run under the Service Account. The Service Account can now open Access without pop-ups that require a response, thus it runs "behind the scenes" and does not visually open Access.

    Author Closing Comment

    I was able to resolve the issue, and included the details in my comments.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    Synchronize a new Active Directory domain with an existing Office 365 tenant
    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 specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now