database 运行 MS Access 查询的批处理文件和
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 
原文地址: http://stackoverflow.com/questions/15220462/
Warning: these are provided under cc-by-sa 4.0 license.  You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Batch file to run an MS Access query and
提问by user2134579
I have an Access DB which has query to retrieve data from teradata. I want to create a batchfile which will execute that particular query.
我有一个 Access DB,它具有从 teradata 检索数据的查询。我想创建一个批处理文件来执行该特定查询。
回答by RichardC
You can create a macro to run the query and then exit Access, then use a command line switch to automatically run this from a batch file.
您可以创建一个宏来运行查询,然后退出 Access,然后使用命令行开关从批处理文件中自动运行它。
Example:
例子:
"C:\Program Files\Microsoft Office\Office11\msaccess.exe" "C:\Program Files\Microsoft Office\Office11\samples\northwind.mdb" /X mcrRunQueryAndQuit
More detail on Access command line switches: http://support.microsoft.com/kb/209207
有关 Access 命令行开关的更多详细信息:http: //support.microsoft.com/kb/209207
(Should work for Access 2000 - 2010)
(应该适用于 Access 2000 - 2010)
回答by Raptor
VBA for Microsoft Access is your key.
适用于 Microsoft Access 的 VBA 是您的关键。
Video tutorial: http://www.youtube.com/watch?v=G9pqmd2PSYk

