A few hints before we start,
cnStr="Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & sPath + ";" & _ "Extended Properties='text;HDR=YES;FMT=CSVDelimited;'; " cnStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDir;Extended Properties='text;HDR=YES;FMT=CSVDelimited;'; "
As an alternative, you can specify a "schema.ini" file. But, that is waaaaaaaaay beyond what I'm trying to accomplish here... (Good luck)
Property Name | Description | Value(s) | ||||
---|---|---|---|---|---|---|
Provider | Name of provider. Since ADO.NET doesn't have one inherantly, use OleDB. | Microsoft.Jet.OLEDB.4.0 | ||||
FMT | File is "formatted" using a specific style or delimiter |
Delimited Each field of the file is "delimited". The default is a comma (,) Delimited(x) Each field of the file is "delimited" by the value within the parentheses. Example of using a pipe charater: Delimited(|). CSVDelimited Each record/row in he file is formatted using QUOTED/Comma separated values. Ex: "Bob","Johnson","123 anystreet" TabDelimited Each field in each record of the file is separated by a TAB character. Ex: bob
| HDR |
The first row in the file is the "Header". It contains the names of the fields/columns |
YES It DOES have a header row |
NO It does NOT have a header row |