title: Querying Access database in SharePoint folder, creates a ".laccdb" file in Recycle bin
body: <p>As in the subject line, running a SELECT statement on this database from an Excel macro puts a &quot;.laccdb&quot; file in the recycle bin - is there any way to avoid this?</p>
  <p>VBA:</p>
  <pre><code>Sub QueryDbOnSP()
      Dim cn As Object
      Dim rs As Object
      Dim cnStr As String
      Dim qryStr As String
      Dim WebDavStr As String
      
      WebDavStr = &quot;\\....\myDbName.accdb&quot;
      Set cn = CreateObject(&quot;ADODB.Connection&quot;)
      cnStr = &quot;Provider=Microsoft.ACE.OLEDB.12.0;Data Source=&quot; &amp; WebDavStr
      qryStr = &quot;SELECT * FROM [Table1];&quot;
      cn.Open cnStr
      Set rs = cn.Execute(qryStr)
      'rest of code
  
  End Sub
  </code></pre>