Consulting

Results 1 to 5 of 5

Thread: How to import multiple columns from a csv file into multiple table in MS Access 2016

  1. #1
    VBAX Newbie
    Joined
    Oct 2021
    Posts
    1
    Location

    Question How to import multiple columns from a csv file into multiple table in MS Access 2016

    I have a CSV file which imports into Excel as more than 255 columns (actually 666 columns).

    As Access has a 255 column limit I need to parse the CSV file and import these into 10 different tables (254 columns and one link column).

    How can this be achieved in VBA? I need vba as the CSV changes over the year and has a different name depending on when it is generated.

    Most columns do/have nothing in them but it is the only output created.

  2. #2
    see this demo, sorry unable to upload here.
    https://www.dropbox.com/s/rnftc6bo5u...666.accdb?dl=0

  3. #3
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    I posted how to split the incoming data in the 1st post at the head of the this forum.

    Why 10 tables, why not 3?

  4. #4
    it is not enough that you split the CSV column header to a set of 254 + 1 (or less).
    you also need to determine the Fieldtype and Fieldlength, so you can construct the field properly
    on creating new table rather than assign them all as Short text.
    this is handled on my demo (see the link).

  5. #5
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    OK.

Tags for this Thread

Posting Permissions

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