Consulting

Results 1 to 7 of 7

Thread: fast way to import csv files

  1. #1

    fast way to import csv files

    HI,

    I want to import csv file with more than 600,000 records. I usually import it thru import wizard. Is there any other way to import it faster?

  2. #2
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    Quote Originally Posted by sai_golden
    HI,

    I want to import csv file with more than 600,000 records. I usually import it thru import wizard. Is there any other way to import it faster?
    define 'faster'

  3. #3
    It usually takes 45 Minutes to upload the file. I tried opening it as a link file but some of the data appears junked like "######" for dates etc.

    (a) Is there any way to write a code in VBA to detect the datatype and import
    (b) Is there any way to reduce the duration of import.

    Thanks

  4. #4
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    Quote Originally Posted by sai_golden
    It usually takes 45 Minutes to upload the file. I tried opening it as a link file but some of the data appears junked like "######" for dates etc.

    (a) Is there any way to write a code in VBA to detect the datatype and import
    (b) Is there any way to reduce the duration of import.

    Thanks

  5. #5
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    Quote Originally Posted by sai_golden
    It usually takes 45 Minutes to upload the file. (a) Is there any way to write a code in VBA to detect the datatype and import
    (b) Is there any way to reduce the duration of import.

    Thanks
    for (a) - YES - use schema.ini

    for (b) -hard to say, normally [in my experience] any slowdown is due to date-type translation, and for real importing, like in your instance, the Wizard probably sucks. Today I uploaded 1/4 million rows to SQL Server in under 2 seconds using ADO and OpenDataSource(). So I would recommend ADO.

    .02 Stan

  6. #6
    Thanks Stanl

  7. #7
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    It should not take that long using VBA code.
    I have posted various Import routines for importing on this forum
    This is one
    http://www.vbaexpress.com/forum/show...ds-into-Access

Posting Permissions

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