By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,659 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,659 IT Pros & Developers. It's quick & easy.

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

P: 27
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?
Aug 24 '09 #1
Share this Question
Share on Google+
4 Replies

Expert 2.5K+
P: 2,878
Can you use a saved DSN? Or why not use a trusted connection instead?

Good luck.

--- CK
Aug 24 '09 #2

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

Aug 25 '09 #3

Expert 2.5K+
P: 2,878
Build your connection string. Here, read this

Good luck!

--- CK
Aug 25 '09 #4

P: 19
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,
Aug 25 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.