title: Connection string for SQL Server 2014 Express (VBA)
body: <p>I am trying figure out what needs to go in the connection string for SQL server via VBA. </p>
  
  <p>This is the code I have right now,</p>
  
  <pre><code>Sub ConnectSqlServer()
  
      Dim conn As ADODB.Connection
      Dim rs As ADODB.Recordset
      Dim sConnString As String
  
      ' Create the connection string.
      sConnString = "Provider=SQLOLEDB;Data Source=INSTANCE\SQLEXPRESS;" &amp; _
                "Initial Catalog=MyDatabaseName;" &amp; _
                "Integrated Security=SSPI;"
  
                  ' Create the Connection and Recordset objects.
                  Set conn = New ADODB.Connection
                  Set rs = New ADODB.Recordset
  
                  ' Open the connection and execute.
                      conn.Open sConnString
  
  
                        'Do my stuff here
  
  
                      If CBool(conn.State And adStateOpen) Then conn.Close
                  Set conn = Nothing
                  Set rs = Nothing
  
  End Sub
  </code></pre>
  
  <p>Problem is I don't know what to put in the Connection string. My full File Path is this.</p>
  
  <pre><code>C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\Staff_Manager.mdf
  </code></pre>
  
  <p>Can someone tell what needs to go with the,</p>
  
  <pre><code>"Provider"
   "Source"
   "Initial Catalog"
  </code></pre>
  
  <p>Thanks.</p>