title: Check whether OleDb 12.0 driver for MS Access is installed or not
body: <p>I have a C# application which uses OleDb 12.0 driver to connect to an MS Access database. If the OleDb 12.0 driver is not installed, the application throws an exception which is not relevantly explanatory.</p>
  
  <pre><code>public static class Program
  {
      private static Mutex mutex = null;
      [STAThread]
      static void Main()
      {
          try
          {
              InMemoryValues.CorrectnessRepetition = 15;
              InMemoryValues.MultipleChoiceCount = 6;
          }
          catch(Exception ex)
          {
              MessageBox.Show(ex.Message.ToString());
          }
  
          ... ...
          ... ...
  
          Application.EnableVisualStyles();  
          Application.SetCompatibleTextRenderingDefault(false);  
          Application.Run(new CollectionForm());  
      }  
  }
  </code></pre>
  
  <p>I want to let users know about the specific problem of not having a driver. I don't want to hard-code the information.</p>
  
  <p>How should I do that?</p>
  
  <p><strong>Relevant Source Code</strong></p>
  
  <pre><code>public static class InMemoryValues
  {
      private static ApplicationData _appData = null;
      public static int CorrectnessRepetition { get; set; }
      public static int MultipleChoiceCount { get; set; }
  
      static InMemoryValues()
      {
          _appData = ApplicationDataBLLL.Get();
  
          if (_appData == null)
          {
              _appData = new ApplicationData();
          }
      }
  
      public static ApplicationData ApplicationData
      {
          set 
          {
              _appData = value;
          }
          get 
          {
  
              return _appData;
          }
      }
  
      public static void Save()
      {
          ApplicationDataBLLL.Save(_appData);
      }
  }
  </code></pre>