title: Excel VBA connect to MySql server
body: <p>I set up a test database at db4free.net and uploaded a copy of the northwind training database to it, to see if I could pull some information to an excel workbook and keep getting the generic unspecified/automation error.</p>
  <p>I included &quot;Microsoft ActiveX Data Objects 2.8 library&quot; in the references and even tried 6.1 for good measure.</p>
  <p>Before anyone freaks out at me including the username and password; the only thing that exists on this test database is a training dataset. I have ZERO personal information stored there.</p>
  <p>Here is my code:</p>
  <pre><code>Sub sqlTest()
      'Declare some strings to hold the connection string and the SQL statement
      Dim cnStr As String
      Dim sqlStr As String
      
      'Define a connection and a recordset to hold extracted information
      Dim oConn As ADODB.Connection
      Dim rcSet As New ADODB.Recordset
      Set oConn = New ADODB.Connection
      Set rcSet = CreateObject(&quot;ADODB.Recordset&quot;)
      
      'connection string to connect to db4free.net
      cnStr = &quot;Driver={MySQL ODBC 8.0 Unicode Driver};SERVER=85.10.205.173;DATABASE=resumedemo;PORT=3306;UID=jwaycaster;PWD=resumedemo123;&quot;
      
      'Test SQL query
      sqlStr = &quot;SELECT * FROM `Employees`&quot;
      
      'This is where it crashes
      oConn.Open cnStr
      
      oConn.CommandTimeout = 900
      
      rcSet.Open sqlStr, oConn
      
      Sheets(1).Range(&quot;A1&quot;).CopyFromRecordset rcSet
      
      rcSet.Close
      
      oConn.Close
  End Sub
  </code></pre>
  <p>I've search around several related topics and can't seem to find the answer. Hopefully I'm missing something simple.</p>
  <p>EDIT for posterity: After reading responses I realized that the drivers are not installed on this computer (I'm visiting relatives and can't believe I forgot to check that). After installing the drivers and updating my references my code executes just fine, but I would suggest using CDP1802's instead.</p>