title: VBA connect to SQL Server data source name not found and no default driver specified?
body: <p>I have the following VBA code and I am getting the error message stated in the title of this question. Can anybody please help? I don't usually write this sort of code:</p>
  
  <pre><code>Sub Save_To_DB()
  'Declare some variables
  Dim cnn As ADODB.Connection
  Dim cmd As ADODB.Command
  Dim strSQL As String
  
  'Create a new Connection object
  Set cnn = New ADODB.Connection
  
  'Set the connection string
  cnn.ConnectionString = "Server=server_name;Database=database_name;Trusted_Connection=True;"
  
  'Open the Connection to the database
  cnn.Open **&lt;-THE ERROR THROWS HERE**
  
  'Create a new Command object
  Set cmd = New ADODB.Command
  
  'Associate the command with the connection
  cmd.ActiveConnection = cnn
  
  'Go on to write the SQL statement and execute
  </code></pre>
  
  <p>EDIT: Ok I solved it, needed to include <code>Driver={SQL Native Client};</code> in the connection string.</p>