PDA

Click to See Complete Forum and Search --> : Text Delimiters


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

SteveFlitIII
Oct 31st, 2000, 04:00 AM
Gary,

If You use the ODBC text driver I think you can specify the delimeter in a file which must be called schema.ini and this file has to be located in the same directory as the source text file.
I'll try and dig out some code.
Ta
SteveFlit
Also at ANKER