title: Opening ADODB.Connection - Receiving error: "Data source name not found and no default driver specified."
body: <p>On <code>oConn.Open</code> I get the error</p>
  
  <blockquote>
    <p>[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified</p>
  </blockquote>
  
  <p>The goal of the project is to generate a report in Excel from the SQL database. This is a first go round to test the concept and see how expansive we could make it. The stored proc works, I have verified in SQL.</p>
  
  <p>I've verified that there is the Microsoft ActiveX Data Objects 6.1 Library.  I know there is also 2.8 but I chose to use the most recent extension.</p>
  
  <p>I don't know if I need to run anything or connect it anyway. I've run "ODBC Data Sources (64-bit)" however I've not edited anything in the ODBC.</p>
  
  <p>Here is all the code I am running in VBA.</p>
  
  <pre class="lang-vb prettyprint-override"><code>Sub DataTakenFromSQL()
  Dim oConn As New ADODB.Connection
  Dim rs As New ADODB.Recordset
  Dim fld As ADODB.Field
  Dim mySQL As String
  Dim Row As Integer
  Dim Col As Integer
  Dim ws As ThisWorkbook
  Set ws = ThisWorkbook
  Application.ScreenUpdating = False
  Set oConn = New ADODB.Connection
  Set rs = New ADODB.Recordset
  mySQL = "EXEC [StoredProc] @var = 'nVarChar'"
  oConn.ConnectionString = "{SQL Server};" &amp; _
    "Server=[SERVER];uid=[UN];pwd=[PW];database=[DATABASE]"
  oConn.ConnectionTimeout = 90
  
  oConn.Open
  
  rs.Open mySQL, oConn
  If rs.EOF Then
      MsgBox "No Matching Records"
      rs.Close
      oConn.Close
      Exit Sub
  End If
  Row = 5
  Col = 1
      For Each fld In rs.Fields
      Sheet1.Cells(Row, Col).Value = fld.Name
      Col = (Col + 1)
      Next
  rs.MoveFirst
  Row = Row + 1
  Do While Not rs.EOF
      Col = 1
      For Each fld In rs.Fields
      Sheet1.Cells(Row, Col).Value = fld
      Col = Col + 1
      Next
  Row = Row + 1
  rs.MoveNext
  Loop
  rs.Close
  oConn.Close    
  End Sub
  </code></pre>