if I use the following :
conn.Open "DRIVER={Microsoft Text Driver (*.txt; *.csv)};" & _
"DBQ=" & sFilePath & ";FMT=TabDelimited;", "", ""
it does not work.
Thanks
Jessie
¤ Hi, I can connect to text file driver with coma delimited file, how not Tab
Tab delimited files require a schema.ini file which would look something like the following:
[TabDelimitedFile.txt]
ColNameHeader=True
Format=TabDelimited
CharacterSet=ANSI
...and is placed in the same location as the text file.
I would use the Jet OLEDB provider with the Text driver to open the file:
Dim ConnectionString As String
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "E:\My Documents\TextFiles" & ";" & _
"Extended Properties=""Text;HDR=NO;"""
Dim TextConnection As New System.Data.OleDb.OleDbConnection(ConnectionString)
TextConnection.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("SELECT * FROM TabDelimitedFile.txt",
TextConnection)
Dim ds As New DataSet("TextFiles")
da.Fill(ds, "TabDelimited")
Paul ~~~ pcle...@ameritech.net
Microsoft MVP (Visual Basic)
Jessie
"Paul Clement" <UseAdddressA...@swspectrum.com> wrote in message
news:g8nph0l4tl1a4mat1...@4ax.com...