title: Performance issue with access to excel vba
body: <p>I need to get data from Access to excel vba, I use ADODB.
  My problem is that although the database is relatively small and query results 30-40 records only, the process gets stuck either with the ".open" or with "copyfromrecordset" line and takes 40-50 secs to display the records.
  This is my code.
  I made some tests with different cursor types and locktypes with no result. The query is working executed directly from access and I have no issue when the connection points locally to my PC. I am on office 365. I referenced the activex data objects 2.8 library.</p>
  
  <pre><code> Sub loadTestDisplay2()
      Dim myConnectiom As ADODB.Connection
      Dim myRS As ADODB.Recordset
      Const conStringNet As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\ourserver-f04\COE-Shared\Data Tool\Access\adsLoadTest.accdb; Persist Security Info=False;"
  
      Dim sql As String
      sql = "SELECT * FROM tblLoad where user is Null"
  
      Set myConnection = New ADODB.Connection
      Set myRS = New ADODB.Recordset
  
      myConnection.ConnectionString = conStringNet
      myConnection.Open
  
      With myRS
          .ActiveConnection = conStringNet
          .Source = sql
          .LockType = adLockReadOnly
          .CursorType = adOpenForwardOnly
          .Open
      End With
  
      Sheets.Add
      Range("A2").CopyFromRecordset myRS
  
      myRS.Close
      myConnection.Close
  End Sub
  </code></pre>