I have been trying to connect to a local SQL server that I have created via excel VBA but am having issues. I am able to connect to the database using the "Get Data" functionality within excel and entering in the server as "(Local DB)\MSSQLLocalDB". However when I try connecting using VBA it does not work. Using windows authentication. Any ideas? Here is the string I used:
strConnString = "Provider=SQLOLEDB;Data Source=(LocalDB)\MSSQLLocalDB;Integrated Security=SSPI"
The error I get is "Run-time error '2147467259 (80004005)':
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.