Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2006
    Posts
    1

    Unanswered: How to import CSV files and combine them in access

    Hi,
    I have quite a few CSV files would like to import into access table .
    but would like to combine them when its being import .

    Sample data

    3S13H7766 HD#0 63.5 HD#1 63.5 HD#2 57.9 CM 7.015 CM Shift 0.1 HSA01 DVH01 1/8/2006 12:13:54 OK
    3S13H7764 HD#0 57.9 HD#1 58.7 HD#2 63.5 CM 7.059 CM Shift 0.1 HSA01 DVH01 1/8/2006 12:14:14 OK

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    Probably the easiest thing to do is to link to the files one at a time. When you do it, name the resulting table something generic, tblIncomingData. Then create an append query that appends the tblIncomingData to another table with all the records in it.

    The key is creating a Link Specification that you can use with the TransferText method of the DoCmd object. To start, choose File/Get External Data/Link. Then when the linking wizard comes up, hit the Advanced button. There you tell access whether it is a delimited file or a fixed file, the fieldnames and types. Make sure to save and name the specification, then you can use it with the TransferText method and write a few more lines of code to import all the files.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •