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

Posted on 2009-12-28
Last Modified: 2013-12-05
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.
Question by:plewk
    LVL 84

    Accepted Solution

    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.
    LVL 28

    Assisted Solution

    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
    LVL 84
    Thanks Andrew!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now