>If I'm interpreting the situation right, then you've got a mismatch between the CSV file and the sample table. If aDV[] array is being populated from the CSV and the cFlds[] is populated from the table, then it means you've got more columns in the table than there are in the CSV file.
That's another trouble with csv files, that the number of expected fields may not be met. It quite often happens that there's a delimiter inside a field value, or that some of the trailing fields are not exported when blank (yup, seen that too, perhaps not from spreadsheet apps but maybe Clarion or other apps which are able to export).
One solution is to dimension the column names array from the file itself, reading the first row as column names. Which is still not foolproof, as it can also happen that there's a column without a header.
CSV is a bread with seven crusts.