D
Darin
I have the following code that opens a comma-delimited text file:
connS = "Provider=Microsoft.Jet.OLEDB.4.0;"
connS &= "Data Source=\tmp;"
connS &= "Extended Properties=""text;HDR=No;FMT=Delimited"""
Dim tmpConnection As New System.Data.OleDb.OleDbConnection(connS)
tmpConnection.Open()
strsql = "SELECT * FROM PAYROLL.TXT"
Dim da As New System.Data.OleDb.OleDbDataAdapter(strsql, tmpConnection)
Dim ds As New DataSet("Workbook")
Dim dt As DataTable
Dim drRow As DataRow
da.Fill(ds, "Sheet1")
dt = ds.Tables("Sheet1")
When the file name is PAYROLL.TXT, this works perfectly. When the file
name is PAYROLL.DAT, I receive an error:
Cannot update: Database or object is read-only
on the line da.fill.
Why?
Darin
connS = "Provider=Microsoft.Jet.OLEDB.4.0;"
connS &= "Data Source=\tmp;"
connS &= "Extended Properties=""text;HDR=No;FMT=Delimited"""
Dim tmpConnection As New System.Data.OleDb.OleDbConnection(connS)
tmpConnection.Open()
strsql = "SELECT * FROM PAYROLL.TXT"
Dim da As New System.Data.OleDb.OleDbDataAdapter(strsql, tmpConnection)
Dim ds As New DataSet("Workbook")
Dim dt As DataTable
Dim drRow As DataRow
da.Fill(ds, "Sheet1")
dt = ds.Tables("Sheet1")
When the file name is PAYROLL.TXT, this works perfectly. When the file
name is PAYROLL.DAT, I receive an error:
Cannot update: Database or object is read-only
on the line da.fill.
Why?
Darin