Trying to use MS JET database engine to read delimited text file from C#. Get error saying 'Cannot Update. Database or object is read-only'
Posted on 2008-06-10
Im trying to use MS JET database engine from C# to read a delimited text file. I'm using the schema.ini file in the same folder as the file Im trying to read.
My connection string is: "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties='text;HRD=No;FMT=Delimited';Data Soruce=c:\\temp\\inventory\\download"
the select query Im using is just "select * from abc.txt"
The file uses the '~' character as the delimter, so i have specified this in the schema.ini file using
Other than the non-standard delimiter, i have used this connection string and select query to read in other delimited text files successfully
I'm not trying to update the file in any way, just to read from it. Just in case though, i have checked to see that the read-only attribute for the file is not on.
I get an OleDbException saying 'Cannot Update. Database or object is read-only'. Thing is, Im not trying to update anything.
Anyone have any ideas ?