Automate an Access task

S

Shabbir Hussain

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
 
N

Nikos Yannacopoulos

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
 
M

Michael Bednarek

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.
 
Top