TransferText command - any help appreciated!!!

A

ac512

Hello

I am using access 2007, and every month I have around 200 csv files that I
have to load into a table in my database.
In the past, I have used the TransferText command to automatically upload a
single file into my database, but I have not been able to do so with multiple
files.

The file names have a consistent beginning & end, but the middle is
different, for example 1 file may be called "quotes_nswapp_pif_200905.csv"
and another file may be called "quotes_vic_pif_200905.csv". I have tried
using wildcards and a loop statement so that I reference all of the separate
files so as to load them, but I have not had any success.

Any suggestions/guidance would be greatly appreciated

Thanks in advance
Kind regards
AC
 
J

John W. Vinson

Hello

I am using access 2007, and every month I have around 200 csv files that I
have to load into a table in my database.
In the past, I have used the TransferText command to automatically upload a
single file into my database, but I have not been able to do so with multiple
files.

The file names have a consistent beginning & end, but the middle is
different, for example 1 file may be called "quotes_nswapp_pif_200905.csv"
and another file may be called "quotes_vic_pif_200905.csv". I have tried
using wildcards and a loop statement so that I reference all of the separate
files so as to load them, but I have not had any success.

Any suggestions/guidance would be greatly appreciated

Thanks in advance
Kind regards
AC

Take a look at the Dir() function VBA help; it recognizes wildcards so

Dir("quotes*.csv")

should let you loop through all the files with such names.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top