Automate an Access task

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to automate the task of importing a text delimited file to an Access
table. How can i write a .bat for this purpose? What are the ways of doing
it? Can you give some code help?

Thanks and regards
 
Shabbir,

I don't think you can do it with a .bat file. Here's an alternative:
Make a new .mdb file, and link the table in the original .mdb in which
you want to import the text file. Then make a macro to do the import and
close the database, and call the macro Autoexec (so it executes upon
opening the .mdb). In essense, whenever you open this database, it does
the import (in the original database, where the table is actually
stored!) and then closes automatically. Just use a scheduled task to
open the particular .mdb, and it will do the job.

HTH,
Nikos
 
I want to automate the task of importing a text delimited file to an Access
table. How can i write a .bat for this purpose? What are the ways of doing
it? Can you give some code help?

Thanks and regards

Write a macro to do the import; invoke the macro from a command line
with the switch "/x".

Alternatively, you can write VBS code to run Access and perform the
import, and run the VBS file from a batch file. Writing that VBS code is
not quite trivial when done from Notepad or such.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top