0

I'm trying to connect in excel vba to a azure sql database using adodb and AD Integration but none of the connection strings I am using seem to work.

I am using ADODB.Connection in conjunction with the string below to connect to my sql server.

I've tried without using AD integrated security (that is, with a username and password) Public Const ConnectionString = "Provider=sqloledb;Data Source=company.database.windows.net; Initial Catalog=testdb; User Id=userinput; Password=pwinput;" and that works fine.

but trying with AD integration doesnt work (gives an error of invalid connection string attribute)

Public Const ConnectionString = "Provider=sqloledb;Data Source=company.database.windows.net; Initial Catalog=testdb;Authentication=ActiveDirectoryIntegrated;Encrypt=True"

I have tried with and without the end bit of Encrypt=True and still get the same error

  • I found this stack question that does somewhat help me out, the trick is to not use provider = sqloledb and instead use driver = odbc driver 17: https://stackoverflow.com/a/64881286/21205485 – user21205485 Feb 14 '23 at 13:16

0 Answers0