Quantcast
Channel: General Office Development forum
Viewing all articles
Browse latest Browse all 2257

Microsoft.ACE.OLEDB.12.0 provider and text file without extension

$
0
0

Windows 7 64-bit. Trying to read text file with C#

ConnectionString

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=N:\TestFiles;Extended Properties="text;HDR=NO;FMT=Delimited(|)";

using(System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(ConnectionString))
{
                conn.Open();
                System.Data.OleDb.OleDbCommand cmd = conn.CreateCommand();
                cmd.CommandText = "SELECT * FROM [DataFile]";
                string bc = (string)cmd.ExecuteScalar();
}

An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll
Additional information: Cannot update. Database or object is read-only.

It looks like I have to modify DisabledExtensions at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Access Connectivity Engine\Engines\Text

How can I add null file extension?


Viewing all articles
Browse latest Browse all 2257

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>