Issue:
I would like to connect from Microsoft Excel 365 to a database inside the Microsoft SQL Server 2016.
The connection string includes already an username and password from an account, which is created on the specific SQL Database as user.
There is one issue, when I would like to extend the connection string with this: Trusted_Connection=YES
In that case, it doesn't work. I'm receiving the following error message:
SQLState: '28000'
SQL Server-Error: 18456
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'DOMAIN\CurrentLoggedInWindowsUsername'
When I remove the connection string Trusted_Connection=YES the connection works very well.
Workaround:
I did find one workaround. When I create on the MS Sql Server an login account for the specific windows user account, the user is able to connect to the database with a trusted connection.
But I don't like to do this, because I already created a specific user, which is mentoined in the connection string. In additional, I would like to share this excel with multiple users, which I don't want to create for everyone an login, inside the Microsoft SQL Server.
Please note, that I already make sure that the SQL Server and windows Authentication mode is set.
Question:
Do you have an idea, how I can make sure to make a trusted connection string, without adding each windows user account inside the Microsoft SQL?
Trusted_Connection=YESthen this sounds like you're saying your passing that parameter along with some windows credentials. That isn't how it works. You either pass the Login and Password, and use SQL Authentication, or use a Trusted Connection. But this is a guess, based on the information we have. If you review the SQL Server's logs, you'll see the real authentication failure reason.