>Is there any way to run an Access query or macro via vbscript?
'
' Run under CSCRIPT
'
Dim oDB
Dim dpPath
dbPath = "D:\Databases\Test01.mdb"
Set oDB = GetObject(dbPath)
oDB.DoCmd.RunMacro "macTestAuto"
Set oDB = Nothing
Wscript.Echo "Done..."
Steve
Steve
.
This should work
"C:\Program Files\Microsoft Office\Office\Msaccess.exe" _
"C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb" _
/x "Orders"
/x macro Starts Microsoft Access and runs the specified macro.
Another way to run a macro when you open a database is to use
an AutoExec macro. Access database or Access project
You can also create a macro called autoexec and it will auto run when access
is opened. Making the previous example work.
For more information on switches go to MS Access help "Startup command-line
options"
and for more info on Autoexec go to "Carry out an action when my database
first opens"
Mark Teasdale
I only wish I know as much about VBS as I do Access
Ian Joyce <idream...@yahoo.com> wrote in message
news:<0a7501c0dfc8$37489210$b1e62ecf@tkmsftngxa04>...
Steve
.
----------
Ian Joyce <idream...@yahoo.com> wrote in message
news:0a7501c0dfc8$37489210$b1e62ecf@tkmsftngxa04...