1

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.

2
  • 1
    teradata ? what did you try ?
    – Raptor
    Mar 5, 2013 at 9:56
  • i have a huge datasource in teradata.. my query executes fine... but i want it to be executed from a batch file so that the user need not open Access and run the query... Mar 5, 2013 at 10:06

2 Answers 2

9

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.

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

(Should work for Access 2000 - 2010)

1
  • thanks a lot Soupy.. it just worked fine.. all i need to do is schedule the task which i can do it from a scheduler... I tried to create a .vbs file which did not work with my .accdb Access database. Now with the above code i created a .bat and it worked perfect. Thanks again. Mar 6, 2013 at 6:29
0

VBA for Microsoft Access is your key.

Video tutorial: http://www.youtube.com/watch?v=G9pqmd2PSYk

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.