I have a native C++ app within which I am trying to connect to a localdb instance using ADO. Having manually started my instance I can run sqllocaldb info v11.0
and see the database instance is running.
My code is as follows.
ADO::_ConnectionPtr spConnection (__uuidof (ADO::Connection));
spConnection->Open (L"Provider=SQLNCLI11;Server=(localdb)\\v11.0;Integrated Security=true", L"", L"", 0);
The error code is DB_E_ERRORSOCCURRED (0x80040e21) and the error message is Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
I am able to successfully connect to the database using SQL Server Management Studio and I've tried it both with and without the provider in the connection string as well as specifying an initial catalog.