Reading CSV file with ODBC Text Driver and Retain Field Format
Posted on 2006-04-06
I am using the MS ODBC text driver to read a CSV file. My logic is fairly dynaminc in that I do not know the number of fields or their format before-hand. I would like to read the fields in as text fields so the formatting in the csv file is retained. My problem is that I have a field that is being interpreted as a numeric field and the leading zeroes are being dropped. For example, '0403100' is being read in as '403100'. Again, I don't know which field in the table this will be. I simply want to read the field in as a text field retaining all formatting in the file. I can not save the CSV file with quotes around the fields either. Any ideas?