Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to go about importing a CSV file into an Access Table?

Status
Not open for further replies.

Spyder757

Technical User
Joined
Aug 29, 2002
Messages
129
Location
US
I use CMS to export a CSV file, I would like to import this file into my Access database.

The problem I run into is that while the data will always stay in the same order, the headings on the exported file won’t.

Is there anyway I can just tell Access to import the first 3 columns worth of data into my table?

Spyder757
 
Spyder757,

Do'able. Could read the line in and then parse it into an array and then only add the first three fields.

THIS MAY BE A WASTE OF TIME.. Hopefully one of this forum's experts will correct me...

What about adjusting your SQL statement to only read in the first three columns? Although you did not say, one could assume your using SELECT * FROM filename.txt as opposed to SELECT Field1, Field2, Field3 FROM filename.txt. Have not spent any time on reading from ASCII files, but that could solve your problem. Otherwise your due for a little coding.


Only had a minute to do a quick search and found this example writing it to Excel vs Access.

Import data from a text file (ADO)

Good luck.
DougCranston
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top