S
Simon Verona
Not sure if this is the best group... it may be better off in one of the ADO
groups, but I'm sure somebody here knows the answer:
I'm trying to load up a text file using ADO.net, as follows:
Dim TextConnectionString As String
TextConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & FilePath & ";" & _
"Extended Properties=""Text;HDR=NO;FORMAT=Delimited"""
Dim TextConn As New System.Data.OleDb.OleDbConnection(TextConnectionString)
TextConn.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from " &
filename, TextConn)
Dim ds As DataSet = New DataSet("CSVFiles")
da.Fill(ds, filename)
When I run this, it fails at the "fill" statement with the error "Database
or object is read only".
The file in question can definitely be read and written (it's a short CSV
file). What have I done wrong???
Many thanks in advance.
Simon
groups, but I'm sure somebody here knows the answer:
I'm trying to load up a text file using ADO.net, as follows:
Dim TextConnectionString As String
TextConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & FilePath & ";" & _
"Extended Properties=""Text;HDR=NO;FORMAT=Delimited"""
Dim TextConn As New System.Data.OleDb.OleDbConnection(TextConnectionString)
TextConn.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from " &
filename, TextConn)
Dim ds As DataSet = New DataSet("CSVFiles")
da.Fill(ds, filename)
When I run this, it fails at the "fill" statement with the error "Database
or object is read only".
The file in question can definitely be read and written (it's a short CSV
file). What have I done wrong???
Many thanks in advance.
Simon