How do I import a csv file into Access 2007 daily via scheduled tasks?

I would like to setup a daily import of a .csv file containing weather data into an access table via scheduled tasks. The data would be appended to an existing table and if possible i would like any duplicate rows to be removed. I can do the process manually and have saved the process.  I don't have much experience  with vb so any pointers would be appreciated.
Who is Participating?
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Appending a CSV is pretty straight forward, but removing duplicate rows can be complicated - what exactly do you consider to be a "duplicate" row? Which columns would have to be identical in order for it to be duplicated?

To import, you can build a macro which does this for you ... the wizards are pretty good at this, so you should be able to do this easily.

Once you've got your macro working, you can then use a Scheduled Task to call your Access database with the macro:

"full path to msaccess.exe" /x "Macro Name"

This will open Access and run the macro specified.
Hi LSMConsulting, just to say you forgot the database in the command.

"full path to msaccess.exe" "FullPath and Database Name" /x "Macro Name"


"C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE" "C:\My Data\MyDatabase.MDB" /x "My Macro Name"

Cheers, Andrew
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Thanks Andrew!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.