title: ADO Provider: Data source name not found
body: <p>I know this question has been asked before but I can't get the recommendations from previous posts to work. </p>
  
  <p>Below you can see my code which I think is more or less working properly but I always get an error for the data source name.</p>
  
  <p>Any help on that would be very much appreciated! </p>
  
  <pre><code>Sub ADOFromExcelToAccess()
      Dim cn As ADODB.Connection, rs As ADODB.Recordset, i As Long
  
      Set cn = New ADODB.Connection
      cn.Open "Provider = MSDASQL;" &amp;_
        "Data Source = C:\Users\ablohn\Documents\Database2.accdb"
  
      Set rs = New ADODB.Recordset
      rs.Open "NameofTable", cn, adOpenKeyset, adLockOptimistic,    adCmdTable
  
      For i = 1 To 10 
          x = 0
  
          Do While Len(Range("A" &amp; i).Offset(0, x).Formula &gt; 0
              With rs
                  .AddNew
                  .Fields("Name1") = Range ("A" &amp; i).Value
                  'repeated for as many times as needed
                  .Update
              End With
              x = x + 1
          Loop
      Next i
  
      rs.Close
      Set rs = Nothing
      cn.Close
      Set cn = Nothing
  End Sub
  </code></pre>