title: Excel 2010 VBA adodb connection to SQL Server 2010 login timeout
body: <p>I spent several hours on this error and I can't find any relevant solution in my brain or on the internet.</p>
  
  <p>I have written a few VBA macros in Excel 2010 that connect to a SQL Server 2008 database on my computer and get some information back. I used them for a few weeks and they worked fine.</p>
  
  <p>2 days ago I set up SQL Server 2008 and Excel 2010 on a new computer, and tried to import my database and my VBA macros. </p>
  
  <p>Here is the issue: When trying to use the macros, excel stop answering then crashed with a catastrophic failure when I forced the close. So I created a new empty database (called PR_db), created a new excel file, and tried to make just a simple connexion to the database with the following code:</p>
  
  <pre><code>Public Const cString = "Provider=SQLOLEDB; Data Source=tosh-TOSH; Initial Catalog=PR_db;Trusted_Connection=yes"
  
  Dim objMyConn As Object
  Set objMyConn = CreateObject("ADODB.Connection")
  objMyConn.Open
  objMyConn.Close
  </code></pre>
  
  <p>This code worked for weeks on my previous computer. But on the new computer it results in a "login timeout error" 9 times out of 10 (Once in a while it works, then when I try again it doesn't work, even though I didn't change anything!)</p>
  
  <p>I'm really lost here... any idea ?</p>