I use ADO and the ODBC text driver to open a text file and read it into a recordset.
This is my code:
Dim cnCSV As New ADODB.Connection
Dim rs As New ADODB.Recordset
cnCSV.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\;" & _
rs.Open "Select * From " & "Test.TXT", cnCSV, adOpenStatic, adLockReadOnly, adCmdText
But this code doesn't work with fields in the text file are delimited by space.
This is the conten of the text file
Jerry M 28
Jonh M 26
This is the debug info
the output is: 1
How to specify a space-delimited format?
Thanks a lot!