T
tascien
This code is NOT working. Well, the error is saying that the path is
invalid. But how... Before i open the connection, i am doing, if
f.Exists(file) then. so, if that returns true, why the connection
thinks that the file does not exists?
Thanks for your help...
Private Sub dsConn()
Dim file As String = "mt.csv"
Dim ds As New DataSet
Try
Dim f As System.IO.File
If f.Exists(file) Then
Dim ConStr As String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
file & ";Extended
Properties=""Text;HDR=No;FMT=Delimited\"""
Dim conn As New OleDb.OleDbConnection(ConStr)
Dim da As New OleDb.OleDbDataAdapter("Select * from " &
file, conn)
da.Fill(ds, "TextFile")
End If
Catch ex As Exception
MsgBox(ex.Message) <- invalid path. Make sure the file
exists... blah blah...
End Try
End Sub
invalid. But how... Before i open the connection, i am doing, if
f.Exists(file) then. so, if that returns true, why the connection
thinks that the file does not exists?
Thanks for your help...
Private Sub dsConn()
Dim file As String = "mt.csv"
Dim ds As New DataSet
Try
Dim f As System.IO.File
If f.Exists(file) Then
Dim ConStr As String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
file & ";Extended
Properties=""Text;HDR=No;FMT=Delimited\"""
Dim conn As New OleDb.OleDbConnection(ConStr)
Dim da As New OleDb.OleDbDataAdapter("Select * from " &
file, conn)
da.Fill(ds, "TextFile")
End If
Catch ex As Exception
MsgBox(ex.Message) <- invalid path. Make sure the file
exists... blah blah...
End Try
End Sub