Scheduling an Access Macro with a DSN password

Posted on 2010-01-06
Last Modified: 2013-11-27
I have an Access Macro that I need to schedule to run automatically. When I run it manually the DSN asks for a password. Is there a way I can schedule this Macro to run?
Question by:mwmiller78
    LVL 84
    When you created the DSN, did you save the password?

    I'm assuming you're working with linked tables - if so, when you created those links, did you tick the box to save the password?

    AFAIK, you cannot tell Access to pass in your password via the command line (which is what you're using to run this via the scheduler).

    Author Comment

    The DSN is for a Progress Database and was created by some 3rd part software on this particular machine. I did try going in the DSN properties and saving the password but there isn't an option to even enter one in. The driver it uses is
    MERANT 3.60 32-Bit Progress SQL92v9.1D
    When I run the macro, this MERANT SQL92v 9.1D dialog is what is asking for the password.

    Yes, the Macro is taking data from a linked table and putting it into a local Access table. I'll try saving the password for the linked tables and see if that works.
    LVL 84
    You must delete and re-create the linked table to do this.

    Author Comment

    Ok I re-linked the table saving the pw and was able to run the macro without the prompt. I tried saving the macro as a shortcut and scheduling it that way-no dice. Ideas?

    Author Comment

    Just created a batch file to run the macro, same result. When I run the batch manually the marco runs fine. It does have 4 prompts within Access though.

    When I run the batch (or execute the shortcut mentioned earlier) I can see Access start up in the task manager but it just sits idle. I'm assuming it's waiting for input on the prompts.
    LVL 84

    Accepted Solution

    <It does have 4 prompts within Access though.>

    Yes, this would be the issue. Anything you run unattended would have to be fully automated. If any of your process require intervention (or even if the may require intervention from a logic branch or something) you are at risk of this happening.

    Unfortunately, the only way to avoid this is to rework your process such that your code doesn't require intervention.


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
    This article was inspired by a question here at Experts Exchange ( The requirements stated in that question are (1) reduce the file size of a large number of…
    Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    733 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

    24 Experts available now in Live!

    Get 1:1 Help Now