tags:

views:

90

answers:

1

I have an application that reads a delimited file using ODBC. The connection string is as follows:

 cs = @"Driver={Microsoft Text Driver (*.txt; *.csv)};DBQ=" + sPath1;

One of the companies providing a file is not using a header row, and I'm losing the first row of data. Putting HDR=No in the connection string does not seem to help. There is a schema.ini in the target directory.

cs = @"Driver={Microsoft Text Driver (*.txt; *.csv)};HDR=No;DBQ=" + sPath1;

What's the best way to read the first row? I haven't tried the Excel driver because I'm afraid it will interpret data differently.

A: 

The solution is to be sure there is a line reading

ColNameHeader=False

in the schema.ini. Documentation can be found here:

http://msdn.microsoft.com/en-us/library/ms709353%28VS.85%29.aspx

SeaDrive