Connection string for SQL Server 2014 Express (VBA)
I am trying figure out what needs to go in the connection string for SQL server via VBA. This is the code I have right now, 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;" & _ "Initial Catalog=MyDatabaseName;" & _ "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