B
Bill H
I've read text files before using the ODBC text driver, but the extensions
on the files have always been csv or txt. Now I am trying it on a file with
a .log extension and I'm getting a read-only error. If I rename the
extension to *.txt it works fine. I've added the .log to the extensions
list in the connection string.
I'm using the ODBC provider in Ado.Net.
This is my code:
string s = @"Driver={Microsoft Text Driver (*.txt;
*.csv)};Dbq=c:\temp\tmp;";
OdbcConnection cn = new OdbcConnection(s);
cn.Open();
s = "SELECT * FROM iis.log";
OdbcDataAdapter da = new OdbcDataAdapter(s, cn);
DataTable dt = new DataTable();
da.Fill(dt); //Errors on this line
ERROR [42000] [Microsoft][ODBC Text Driver] Cannot update. Database or
object is read-only.
Does anyone know the answer to this ?
Thanks
Bill
on the files have always been csv or txt. Now I am trying it on a file with
a .log extension and I'm getting a read-only error. If I rename the
extension to *.txt it works fine. I've added the .log to the extensions
list in the connection string.
I'm using the ODBC provider in Ado.Net.
This is my code:
string s = @"Driver={Microsoft Text Driver (*.txt;
*.csv)};Dbq=c:\temp\tmp;";
OdbcConnection cn = new OdbcConnection(s);
cn.Open();
s = "SELECT * FROM iis.log";
OdbcDataAdapter da = new OdbcDataAdapter(s, cn);
DataTable dt = new DataTable();
da.Fill(dt); //Errors on this line
ERROR [42000] [Microsoft][ODBC Text Driver] Cannot update. Database or
object is read-only.
Does anyone know the answer to this ?
Thanks
Bill