title: OleDbConnection.Open() throws exception only in one project, same code works in other projects
body: <pre><code>The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
  </code></pre>
  
  <p>I know the common fix for this which is to install:</p>
  
  <p><a href="http://www.microsoft.com/en-us/download/details.aspx?id=13255" rel="nofollow">Microsoft Access Database Engine 2010 Redistributable</a></p>
  
  <p>Or</p>
  
  <p><a href="http://www.microsoft.com/en-us/download/confirmation.aspx?id=23734" rel="nofollow">2007 Office System Driver: Data Connectivity Components</a></p>
  
  <p>Both are installed on my local PC. This is the code which I have</p>
  
  <pre><code>        OleDbConnection conn = new OleDbConnection();
          string fileName = "test.xlsx";
  
  
          try
          {
              string connectString = String.Format(
                  "Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties='Excel 12.0 Xml;HDR={1};'",
                  fileName, "YES");
  
              conn.ConnectionString = connectString;
              conn.Open(); //exception is thrown here !!!
  
              OleDbCommand comm = new OleDbCommand();
              comm.CommandText =
                  string.Format("CREATE TABLE [{0}] ", "Test");
  
              comm.Connection = conn;
              comm.ExecuteNonQuery();
  
              OleDbDataAdapter ad = new OleDbDataAdapter(
                  string.Format("SELECT * FROM [{0}]", "Test"), conn);
              OleDbCommandBuilder builder = new OleDbCommandBuilder(ad);
          }
          catch(Exception ex)
          {
              throw ex;
          }
          finally
          {
              conn.Close();
          }
  </code></pre>
  
  <p>I try this code in other projects on my local machine and everything is working. I have project which creates excel exports and I don't have this problem.</p>
  
  <p>The problem is in the project I don't understand how to fix it. Also on the current project I create one new .aspx page and in Page_Load put only this code, same exception. </p>
  
  <p>Additional information: this project was written on vs 2008, convert to 2010 and after that used in vs 2012. Everything was working in the project till now.</p>
  
  <p>Also same thing for JET connection string !</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>After the answer of <strong>Joe</strong> I see that this project is run on 64bitProcess:</p>
  
  <pre><code>bool test = Environment.Is64BitProcess; //return true.
  </code></pre>
  
  <p>My driver is for 32bit. What I can do now, can I change the environment process. I can't install the driver for 64bit process because I have installed Office 2010 x32.</p>