title: Access DB in network folder cannot be read by ASP.NET
body: <p>I have an ASP.NET page that needs to push some data to an older program that uses an Access 2003 database for a backend.  I have my connection strings all set up to do this (successful to a local copy of the DB) but when I try to read from the database on its network share location, I get the following error:</p>
  
  <blockquote>
    <p><strong>Record(s) cannot be read; no read permission on 'tblDevice'.</strong></p>
  </blockquote>
  
  <p>There are no passwords or any security on the database, so I'm pretty sure this is network related.  I'm not aware of any way to include a network login/password with the <a href="http://www.connectionstrings.com/access" rel="nofollow">connection string</a>.  I would assume it's going to require adding a certain user to the folder.  However, I'm not sure what user needs permission to that folder for it to work (both from Visual Studio and from IIS).  Anyone had experience with this type of error or know what "users" need to be given permission to the folder?</p>
  
  <hr>
  
  <p>My code for reference:</p>
  
  <p><strong>Access connection string</strong></p>
  
  <pre><code>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\srv.local\SHAREDOCS\data.mdb;
      User Id=admin;Password=;
  </code></pre>
  
  <p><strong>Selection Code</strong></p>
  
  <pre class="lang-cs prettyprint-override"><code>public static DataTable GetDevices(string serialNum)
  {
      var conn = new OleDbConnection();
      var builder = new OleDbConnectionStringBuilder();
      builder.ConnectionString = ConfigurationManager.ConnectionStrings["development"].ToString();
      conn = builder.ConnectionString;
  
      var sqlString = "SELECT DeviceID, SN FROM tblDevice WHERE Active=True AND SN=@serialNum ORDER BY SN, DeviceID; "
  
      using (var cmd = new OleDbCommand(sqlString, conn))
      {
          cmd.Parameters.AddWithValue("@serialNum", serialNum);
          var ds = new DataSet();
          var da = new OleDbDataAdapter(cmd);
  
          da.Fill(ds);
  
          return ds.Tables[0];
      }
  }
  </code></pre>