Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / May 2005

Tip: Looking for answers? Try searching our database.

Importing multiple .CSV files into a Table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jasperwt - 25 May 2005 01:39 GMT
Hello

I have been importing .csv files into Access using a Macro which work
great.  Unfortunately, the task has become more intense.  I now hav
20-50 csv files to import the data from.  The names of the file
change over time.  The only redeeming thing is that the files are al
in the same directory.  Does anyone have any ideas on how to automat
this

Thanks in advance for your help

Jaspe
Nikos Yannacopoulos - 25 May 2005 12:13 GMT
Jasper,

You need some VBA code to retrieve the file names in the particular
directory, and import one by one. Here's some sample (untested) code:

Dim fs, fldr, fls, fl
Set fs = CreateObject("Scripting.FileSystemObject")
Set fldr = fs.getfolder("C:\temp\")
Set fls = fldr.files
For Each fl In fls
    If Right(fl.Name, 4) = ".CSV" Then
        DoCmd.TransferText acImportDelim, "YourSpec", _
            "TargetTable", fl.Name
    End If
Next fl

HTH,
Nikos

> Hello,
>
[quoted text clipped - 8 lines]
>
> Jasper
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.