Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! Using Scheduler to update Databases

Status
Not open for further replies.

RDM23

Technical User
May 16, 2007
39
US
Each morning, I am running a macro to build data tables. These tables are built once each morning. My database has a password for security purposes. I am using Windows Scheduler program to execute the macro. Problem is it prompts me for the password. Since I want this to run early AM when nobody is here, does anyone know how to get around this? Such as adding password into the command line in scheduler? Any other options you can think of would be appreciated. Thanks in advance for your help. Here is my current command line in Windows Scheduler. The macro that runs is at the end after the /x.
"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "O:\Inventory.mdb" /x "Create_MasterSourceDataTables
 
Use the following option on the command line:
/pwd password

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks. I added it to the command line and it is still prompting me for a password to logon. Does it matter where I put the command? Below is where I put it. Password is mars I tried it with and without the " " around the password

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "C:\Inventory.mdb" /pwd "mars" /x "Create_MasterSourceDataTables
 
Is the database only password protected or user level secured with a workgroup file ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
The database is Password protected. With this being on network and connected using ODBC, it also requires a username and password. The Username and Password is set right in the schdule task program. The database password is what is giving me issues. When it prompts for database password and I enter the password, everything works fine. Thanks.
 
This actually works for me:

Call Shell("MsAccess.exe FullPathOfYourDatabase /wrkgrp FullPathOfyour.mdwFile /user YourUsername /pwd YourPassword /x NameOfYourMacro", 0)

If the macro calls a VBA function SendKey commands like:
SendKeys "{TAB}", True
SendKeys "{ENTER}",
will simulate actual keystrokes to get around the sercurity prompt.
 
Thanks for your help. Is this for bypassing the "network" user id and Password? If so, Scheduler already handles that. I am looking at bypassing a password on the actual database.

Here is my current run path in the scheduler program.

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "O:\Email.mdb" /x "Create_MasterSourceDataTables_Scheduler"

Would I modify that? If so, what would it need to be changed to? Thanks again for your help.
 
add the /pwd "DBpassword" option to your current run path.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top