View Full Version : import csv file problem


thebolly
04-07-2003, 06:03 AM
Hi,

I'm trying to import csv files which have a header of three lines, the third of which contains the column heading names, the other two are either blank or contian the file name info.

How do I import the file correctly so that the data is all in the right columns and I don't have to import duff data?

Thanks

Ian

Pat Hartman
04-07-2003, 02:40 PM
You can't use TransferText because it expects all rows to be the same format except the first row which may contain headings. You'll either need to strip off the first two records prior to importing or import the file with VBA so you can bypass the unwanted records.

thebolly
04-07-2003, 03:50 PM
thanks again pat, could you give me a pointer to the vba approach

thnks

Pat Hartman
04-07-2003, 07:14 PM
I don't have any sample code but I KNOW that it has been posted here. Try the search feature. In Access help, look for keywords - Open, Input #, Write #. There are code samples.