title: Reading A Fixed Format Text File
body: <p>Its been years since I have had to attempt to read a file using either Microsoft Text ODBC Driver or Microsoft Jet OLE DB 4.0 Provider.</p>
  <p>So I have the following code</p>
  <pre><code>public void Example()
  {
  string CVS = Application.StartupPath;
  string SQL = &quot;SELECT * FROM [MyFile.txt]&quot;;
  string Connection = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot;+CVS+&quot;;&quot;+&quot;Extended Properties='text;HDR=Yes;FMT=Fixed;&quot;;
  OleDbDataAdapter OLE = new OleDbDataAdapter(SQL,Connection);
  DataTable Table = new DataTable();
  OLE.Fill(Table);
  }
  </code></pre>
  <p>When I run the above code I get an &quot;Unexpected Error&quot;, I know I am missing something, I am not sure what exactly.</p>
  <p>Sources:</p>
  <p><a href="http://www.connectionstrings.com/textfile" rel="nofollow noreferrer">http://www.connectionstrings.com/textfile</a><br>
  <a href="http://www.connectionstrings.com/Providers/net-framework-data-provider-for-ole-db" rel="nofollow noreferrer">http://www.connectionstrings.com/Providers/net-framework-data-provider-for-ole-db</a><br>
  <a href="http://www.aspdotnetcodes.com/Importing_CSV_Database_Schema.ini.aspx" rel="nofollow noreferrer">http://www.aspdotnetcodes.com/Importing_CSV_Database_Schema.ini.aspx</a><br></p>
  <p>Any direction would be appreciated.</p>
  <p>Let us assume the Schema.ini file is correct.</p>