title: creating a password protected Access database
body: <p>Using Visual Studio 2010 with a C# WPF project. I know how to create an Access 2000-2003 db file using the ADOX namespace.</p>
  
  <pre><code>ADOX.CatalogClass cat = new CatalogClass();
  string str = "provider=Microsoft.Jet.OleDb.4.0;Data Source=" + _dbPath + ";";
  cat.Create(str);
  cat = null;
  </code></pre>
  
  <p>Connect and open the database:</p>
  
  <pre><code>conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" 
         + _dbPath + ";");
  
  //connect to it with a password
  "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _dbPath + ";User Id=admin;Password=myPassword;"
  </code></pre>
  
  <p>I want to create the file password protected:</p>
  
  <pre><code>ADOX.CatalogClass cat = new CatalogClass();
  string str = "provider=Microsoft.Jet.OleDb.4.0;Data Source=" 
  + _dbPath + ";Password=myPassword;";
  cat.Create(str);
  cat = null;
  </code></pre>
  
  <p>This produces an error at runtime:</p>
  
  <blockquote>
    <p>Cannot start your application. The workgroup information file is missing or opened exclusively by another user.</p>
  </blockquote>
  
  <p>When I create without the password, the database is created successfully.</p>
  
  <p>How can I create a password protected Access database with this strategy?</p>