How to run a scheduled AutoExec Macro that requires an ODBC password

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kini113
    New Member
    • Aug 2009
    • 27

    How to run a scheduled AutoExec Macro that requires an ODBC password

    I want to update my MS Access database every night at 10pm. I have a Macro that runs all of the queries needed to update the database (which is also saved as a VBA module) and an AutoExec Macro to runs the "Update Inventory" macro. I also scheduled the task to run every night a 10pm. The problem i have is that in order to run the "Update Inventory" macro I have to enter my ODBC password and there is no way to save the password. This there a Macro action or VBA code I could add that would enter my password automatically?
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Can you use a saved DSN? Or why not use a trusted connection instead?

    Good luck.

    --- CK

    Comment

    • kini113
      New Member
      • Aug 2009
      • 27

      #3
      I can't figure out how to save a System DSN password. How would I do a trusted connection?

      Thanks
      Cindy

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        Build your connection string. Here, read this

        Good luck!

        --- CK

        Comment

        • dbrother
          New Member
          • Nov 2007
          • 19

          #5
          If you are using passthrough queries in your Macro, you should be able to:
          - open the PT query in Design View
          - then click properties
          - then click the build button at the end of the line that says "ODBC Connect Str" ( it will look like [...] )

          Once you click that button, it will ask for your ODBC connection, choose it and it should open a box that will allow you to enter your password. Enter your password and it will test the connection, then it will ask if you want to save the password in the connection string. Choose yes and this should solve the problem.

          Hope this helps,
          dbro

          Comment

          Working...