title: Connecting to an mdb file using OdbcConnection in VS2013
body: <p>I am trying to connect to an mdb file from C# 2013 using OdbcConnection. I used to have Office 2000 on my Windows 7 and Windows 8 machines, but I have upgraded to Office 2013 on both and it now longer works on either. My database is still in mdb format.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>const string myConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Path\Mydb.mdb";
  OdbcConnection connRL = new OdbcConnection();
  connRL.Open();
  </code></pre>
  
  <p>Whatever I have tried I get the following error:</p>
  
  <blockquote>
    <p>ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not
    found and no default driver specified</p>
  </blockquote>
  
  <p>I have Installed the "Microsoft Access Database Engine 2010 Redistributable" and the "2007 Office System Driver: Data Connectivity Components" but neither of them have made any difference. I can create a new Data Source from the VS 2013 Project menu and that all works at design time.</p>
  
  <p>When I create a blank udl file and double click on it and go to the provider tab there's nothing listed about Access or Jet, but I can see the providers in the registry at HKEY_CURRENT_USER\Software\Microsoft\VWDExpress\12.0_Config\DataProviders. Why aren't they there?</p>
  
  <p>What else can I do to get this to work? I have tried everything I can think of.</p>