Importing csv

Q

QB

I am wanting to automate importing daily CSVs file into my database and was
first trying to do this manually (Import).

The issue I am having is the fact that not all of the columns in the CSV
correspond to the names in the database. The CSV had duplicate names... Is
there a way to tell access that colA corresponds to Field name "Proj No"?

If not, how would I approach this?

Thank you,

QB
 
M

Mr. B

QB,

If it is not possible to have the format of the CSV file modified, then you
could programatically (take a look at the "TransferText" method in VBA code)
import the CSV file to a table made specifically to receive the CSV file as
it exists, even with the extra field(s). The use an append query designed to
only append the fields that you want from the table that has the imported
data and append the data to your acutal working table.

All of this can be done using VBA code.
-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm
 
D

Dale Fye

Have you tried creating an import specification?

It's been a while, and you didn't indicate what version of Access you are
using, but the import wizard used to provide a way (lower left corner) of
creating an import specification, which allows you to tell Acces which fields
to keep, and what to name each of the columns as you import them.

Once you create this import specification, you can use the TransferText
method and specify the import specification you want to use.
 
D

Dale Fye

Have you tried creating an import specification?

It's been a while, and you didn't indicate what version of Access you are
using, but the import wizard used to provide a way (lower left corner) of
creating an import specification, which allows you to tell Acces which fields
to keep, and what to name each of the columns as you import them.

Once you create this import specification, you can use the TransferText
method and specify the import specification you want to use.
 

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