J
Joe Duchtel
Hello -
I need to parse a *.csv file without much effort so I wanted to use an
ADO. I have done that successfully to read from an Excel file
(Extended Properties="Excel 8.0;HDR=NO") but somehow I cannot figure
out *.csv files.
Here is what I have ...
Dim lFileName As String = "C:\"
Dim lConnection As New ADODB.Connection
lConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=" & lFileName & ";" & "Extended Properties=Text;"
lExcelConnection.Open()
The problem is that I cannot specify a file name ABC.csv without
getting an exception of 'C:\ABC.csv is not a valid path.'.
How do I access the data in the *.csv file?
I used the following for Excel but since I use Extended
Properties=Text, I assume I need to do something differently?
Dim lRBTQuery As String = "SELECT * FROM [Sheet1$A1:C1]"
Dim lADORecordSet As New ADODB.Recordset
lADORecordSet.Open(Source:=lRBTQuery, ActiveConnection:=lConnection)
How can I read all lines of the *.csv file?
Any suggestions?
Thanks,
Joe
I need to parse a *.csv file without much effort so I wanted to use an
ADO. I have done that successfully to read from an Excel file
(Extended Properties="Excel 8.0;HDR=NO") but somehow I cannot figure
out *.csv files.
Here is what I have ...
Dim lFileName As String = "C:\"
Dim lConnection As New ADODB.Connection
lConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=" & lFileName & ";" & "Extended Properties=Text;"
lExcelConnection.Open()
The problem is that I cannot specify a file name ABC.csv without
getting an exception of 'C:\ABC.csv is not a valid path.'.
How do I access the data in the *.csv file?
I used the following for Excel but since I use Extended
Properties=Text, I assume I need to do something differently?
Dim lRBTQuery As String = "SELECT * FROM [Sheet1$A1:C1]"
Dim lADORecordSet As New ADODB.Recordset
lADORecordSet.Open(Source:=lRBTQuery, ActiveConnection:=lConnection)
How can I read all lines of the *.csv file?
Any suggestions?
Thanks,
Joe