Forum Discussion
connect to SQL server fails
I have a Power BI report, which uses data from SQL data warehouse. The reports works when I run the query from my local PC or log into a virtual machine using another user account. However, when I try to run the same report use my own account on the same virtual machine, I had an error message. By the way, I can access the same SQL database use my own account on that virtual machine. So assume both Power BI and SQL are functioning, it's something related to my account set upon that virtual machine.
Has anyone enounter this before?
File - Options and settings - Data source settings
Then select your SQL database and select 'edit permisions'
Selec Edit
And there you can change your connection type
6 Replies
- James-HarpinResolver IV
File - Options and settings - Data source settings
Then select your SQL database and select 'edit permisions'
Selec Edit
And there you can change your connection type
- JeanxyzPower Participant
Thank you so much, James! the problem is solved now. It looks once I changed the connection from Microsoft to Windows, it changes the setup of other Power BI reports using the same SQL database..
- James-HarpinResolver IV
Hi Jeanxyz
Try changing your datasource setting from Microsoft Account to Windows Login then try to refresh data.
- JeanxyzPower Participant
How to make the change in account? Do you have a post or printscreen?
- James-HarpinResolver IV
Hi Jeanxyz
Try changing your datasource setting from Microsoft Account to Windows Login then try to refresh data.
- v-luwang-msftCommunity Support
Hi Jeanxyz ,
If you're getting this error after January 2022, possibly after migrating from
System.Data.SqlClienttoMicrosoft.Data.SqlClientor just updatingMicrosoft.Data.SqlClientto version 4.0.0 or later, it's because MS has introduced a breaking change::Breaking changes in 4.0
Changed
Encryptconnection string property to betrueby default.The default value of the
Encryptconnection setting has been changed fromfalsetotrue. With the growing use of cloud databases and the need to ensure those connections are secure, it's time for this backwards-compatibility-breaking change.Ensure connections fail when encryption is required
In scenarios where client encryption libraries were disabled or unavailable, it was possible for unencrypted connections to be made when
Encryptwas set totrueor the server required encryption.Rick Strahl has posted a detailed explanation on his blog
The change was made in this SqlClient pull-request in August 2021, where there is additional discussion about the change.
The quick-fix is to add
Encrypt=Falseto your connection-strings.Similar question refer:
Did I answer your question? Mark my post as a solution!
Best RegardsLucien