dmc183
01-04-2010, 07:15 AM
I have a macro setup in Access that runs several queries against an OBDC data source, then compiles them into a comma delimited file. The script below works fine for that purpose. However, it still requires manual input of the user credentials to access the information I need before the queries will run. Is there a way to include my user information in this script to fully automate the process? Apologies, I'm new to scripting as you can probably tell by how simple this is. Any help would be appreciated, thanks!
Const DBPath = "C:\CONTACTS\DMT.mdb"
Const MacroName = "BCL"
Set AccessApp = GetObject(DBPath, "Access.Application")
AccessApp.DoCmd.RunMacro MacroName
AccessApp.Quit
Const DBPath = "C:\CONTACTS\DMT.mdb"
Const MacroName = "BCL"
Set AccessApp = GetObject(DBPath, "Access.Application")
AccessApp.DoCmd.RunMacro MacroName
AccessApp.Quit