title: "Microsoft.ACE.OLEDB.12.0” not recognized in Windows 10
body: <p><strong>Background</strong></p>
  
  <p>I'm developing a Windows Form application which connects to a Microsoft Access database.</p>
  
  <p>This is a sample code that I use in the development:</p>
  
  <pre><code>try
  {
      string AccessFilePath = @"\.myDataBase.mdb"; // Path of the Access database.
      string sqlStatement = "SELECT * FROM myTable WHERE IdTable = 5;";
      string connstr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + AccessFilePath;
      OleDbConnection conn = new OleDbConnection(connstr);
      OleDbCommand cmd = new OleDbCommand();
      cmd.CommandType = CommandType.Text;
      cmd.CommandText = sqlStatement;
      cmd.Connection = conn;
      conn.Open();
      cmd.ExecuteNonQuery();
      conn.Close();
  }
  catch (Exception ex)
  {
      MessageBox("Error: " + ex.Message);
  }
  </code></pre>
  
  <p>The following list describes the environment of my development:</p>
  
  <ul>
  <li>Visual Studio 2015 Community</li>
  <li>Solution created in Framework .NET 4.0</li>
  <li>Operating system: Windows 10 Pro - 64 bits.</li>
  <li>This development must work on Windows XP, Windows 7 and upper versions.</li>
  </ul>
  
  <p>I had already installed:</p>
  
  <ul>
  <li><a href="https://www.microsoft.com/en-us/download/details.aspx?id=23734" rel="nofollow noreferrer">2007 Office System Driver: Data Connectivity Components</a></li>
  <li><a href="https://www.microsoft.com/en-US/download/details.aspx?id=17851" rel="nofollow noreferrer">Microsoft .NET 4.0</a> <em>(in Windows XP and other computers who needs it)</em></li>
  </ul>
  
  <p><strong>Issues</strong></p>
  
  <p>In my PC <em>which has Windows 10 Pro OS</em>, I search in the <em>C:/</em> Hard Disk and I found that <strong>ACEOLEDB.DLL</strong> is already installed in the following locations:</p>
  
  <p><em>This is <strong>before</strong> install the Data Connectivity Components:</em></p>
  
  <pre><code>- C:\Program Files (x86)\Microsoft Office\root\VFS\ProgramFilesCommonX86\Microsoft Shared\OFFICE16
  - C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE15
  - C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE14
  </code></pre>
  
  <p><em>Click to enlarge the image:</em></p>
  
  <p><a href="https://i.stack.imgur.com/pUuXo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pUuXo.png" alt="Previous to install Data Connectivity Components"></a></p>
  
  <p>When I installed the Data Connectivity Components in my PC, the <strong>ACEOLEDB.DLL</strong> is located at:</p>
  
  <pre><code>- C:\Program Files (x86)\Microsoft Office\root\VFS\ProgramFilesCommonX86\Microsoft Shared
  </code></pre>
  
  <p>I really don't know why <em>even after install Data Connectivity Components</em> I'm still getting this error:</p>
  
  <blockquote>
    <p>"The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine"</p>
  </blockquote>
  
  <hr>
  
  <p><strong>Questions</strong></p>
  
  <ul>
  <li>How Data Connectivity Components are handled by the OS?</li>
  <li>How can validate correctly if OS has the Data Connectivity Components installed?</li>
  </ul>