title: How do I setup an ADODB connection to SQL Server 2008 in Microsoft Access 2010?
body: <p>I just installed SQL Server 2008 on my laptop. I also have Microsoft Access 2010 installed. Using VBA, I am trying to create an ADODB connection to my own database on SQL Server but I'm having trouble finding the right line of code:</p>
  
  <p>When I use this below, it doesn't work.
  The name of my computer is LAPTOPX and the database is HomeSQL.</p>
  
  <p>I am sure it's super easy but since I'm just starting out I can't seem to find the right way to ask the question.</p>
  
  <p>Thanks!</p>
  
  <pre><code>Dim DBCONT As Object
  
  Set DBCONT = CreateObject("ADODB.Connection")
  Dim strDbPath As String
  strDbPath = "LAPTOPX/HomeSQL"
  Dim sConn As String
  sConn = "Provider=Microsoft.ACE.OLEDB.12.0;" &amp; _
                          "Data Source =" &amp; strDbPath &amp; ";" &amp; _
                          "Jet OLEDB:Engine Type=5;" &amp; _
                          "Persist Security Info=False;"
  DBCONT.Open sConn
  </code></pre>