Connecting Tech Pros Worldwide Help | Site Map

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

Newbie
 
Join Date: Aug 2009
Posts: 20
#1: Aug 24 '09
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's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,925
#2: Aug 24 '09

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


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

Good luck.

--- CK
Newbie
 
Join Date: Aug 2009
Posts: 20
#3: Aug 25 '09

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


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

Thanks
Cindy
ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,925
#4: Aug 25 '09

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


Build your connection string. Here, read this

Good luck!

--- CK
Newbie
 
Join Date: Nov 2007
Posts: 19
#5: Aug 25 '09

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


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
Reply