Gary.Lowe
Oct 30th, 2000, 07:52 AM
Hi All
I am using ADO to open a text file into a recordset
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
'open connection to folder that contains the file
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\;Extended Properties=Text;"
'open the file
rs.Open "select * from test.txt", cn
This works fine on a file where the delimiter is a comma i.e.
0,23,"Hello"
But if the dilimiter is a semi-colon it doesn't work i.e.
0:23:"Hello"
Does anyone know if you can specify the delimiter in the connection or recordset object
Thanks
I am using ADO to open a text file into a recordset
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
'open connection to folder that contains the file
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\;Extended Properties=Text;"
'open the file
rs.Open "select * from test.txt", cn
This works fine on a file where the delimiter is a comma i.e.
0,23,"Hello"
But if the dilimiter is a semi-colon it doesn't work i.e.
0:23:"Hello"
Does anyone know if you can specify the delimiter in the connection or recordset object
Thanks