Read Text Files Into a Recordset - Semicolon Delimiter
Posted on 2001-06-18
I am very new in Visual Basic and still learning.
I try to use ADO and the ODBC text driver to open a text file an read it into a recordset.
Below is what I'm doing now in my program :
Dim connCSV As New ADODB.Connection
Dim rsTest As New ADODB.Recordset
connCSV.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
& path & ";Extended Properties='text;HDR=NO;FMT=Delimited'"
rsTest.Open "Select * From test.txt", _
connCSV, adOpenStatic, adLockReadOnly, adCmdText
Do While Not rsTest.EOF
If I have a text file like this :
John, Los Angeles, USA
Mary, New York, USA
I will have rsTest(0) as John, and then Mary.
So far it works, but I must use comma delimiter in my text file.
My question is :
Is it possible to use other character as delimiter in my text file, like semicolon (;) ?
- I use Oracle 8, VB 6, Win2K Pro
- At the first time I didn't have any Schema.ini file, then I tried to copy schema.ini file to c:\WinNT\System32\ and configured it by adding 1 line : "Format=Delimited(;)", but still can't work.
I look forward to your early reply :-)
Your help will be very much appreciated.