Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
SiWill2017
Frequent Visitor

Unable to Connect to SQL Server

 I keep getting the following error message when trying to connect to the companies SQL Server, does anyone have any idea of how to solve this?

 

"An error happened while reading data from the provider: 'Could not load file or assembly 'System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)'"

 

I have tried to install a newer version of .net framework but I have one that is 4.5 or newer.

 

"An error happened while reading data from the provider: 'Could not load file or assembly 'System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)'"

 

Thanks.

1 ACCEPTED SOLUTION

Hello,

I just wanted to add my experience to this. As the Network Manager, I was not comfortable allowing a user to run with admin credentials, so I wanted to find a way around this issue.

 

I also did have to use Run As Admin to get the connection to work. I discovered that I only needed to do that to establish the connection, though. Once I did, the program could then be run without the Run As Admin option and it would work.

 

Hope that helps someone.

View solution in original post

17 REPLIES 17
connect
Helper I
Helper I

Hi, 
I also encountred the same issue. However, solution is quite simple. 
Please run your Power BI Desktop as an Administrator. This will solve this issue. 
PBIDesktopRunAsDifferentUser.png

Please let me know if this solves your issue. For me, it worked perfectly. 

Anonymous
Not applicable

I had the same problem.

The "Run as admin" solution or .NET framework repair/new install did not work!

 

I resolved the issue from inside the pbix file and it was due to the automatic chnages applied in the report data source settings.

Cleared all the permissions for the data sources that had this problem (some of them were with "Windows" credentials and "Organizational" privacy level). Then, set the Credentials to Windows again with the current user authentication and privacy level to "None", all the Credentials encrypted. It worked, finally!

 

Hope this helps 🙂 

I tried all the other solutions mentioned, this is the only one that worked for me.

Anonymous
Not applicable

This issue of “impersonation level” can be resolved by runing Power BI Desktop as administrator before accessing the report. After opening the report in Power BI Desktop being ran as an administrator, it may ask for the encrypion aletrt sometimes.

 

Start > Power BI > right click > select Run as Administrator

See more details:

https://natechamberlain.com/2019/02/12/power-bi-refresh-error-could-not-load-file-or-assembly-provid...

 

kmuchai
New Member

I had the same problem on my installation but only after I had installed the Microsoft Store version of Power BI Desktop. The only way I could get an SQL Database to connect as a data source was to run Power BI as administrator as mentioned by others on this thread. I uninstalled the Microsoft Store version of Power BI and pulled a manual download from the Microsoft Power BI page here :

 

https://powerbi.microsoft.com/en-us/downloads/  (*Make sure to select the Advanced Download Option to manually pull an installable file)

 

I've had no issues connecting to my databases since and I do not run Power BI Desktop as administrator. Hope this helps.

v-sihou-msft
Employee
Employee

@SiWill2017

 

As the error message mentioned, it seems a permission issue when loading the assembly, please try to run Power BI Desktop as administrator. If it still doesn't work, please repair your .NET Framework, restart your server and try again to see if it works.

 

Regards,

Anonymous
Not applicable

Yes right click and run as administrator solves the problem.  But running the pbix as admin prevents from saving the file on network drive. Thats the only problem. 

Thank you. Run as admin worked for me.

Anonymous
Not applicable

Dear @v-sihou-msft ,

It worked for me running as administrator. But is there a way to make it work with a regular user?

I´m using the admin credentials for SQL connection, but wanted to run PowerBI Desktop with regular user.

Thank you,

Eduardo

Yes it worked for me too

Hello,

I just wanted to add my experience to this. As the Network Manager, I was not comfortable allowing a user to run with admin credentials, so I wanted to find a way around this issue.

 

I also did have to use Run As Admin to get the connection to work. I discovered that I only needed to do that to establish the connection, though. Once I did, the program could then be run without the Run As Admin option and it would work.

 

Hope that helps someone.

Hi

I tried to reinstall NET, register and unregoster DLL, etc, etc.

Opening Excel with admin can open a query, but not with my usual user.

 

Finally, ther solution was:

Create a query that works opening excel with admin user, and save the excel file

Open excel with regular user, and open file saved in previous step

Go to Edit query (Power Query Editor) -> Configure data source button -> Edit permissions ->Uncheck cipher connection

Solved

Any new query you create will work as usual

Anonymous
Not applicable

This issue came up this morning for one of my employees. We do not allow Run as Admin for most employees. The solution we used was to go into Power BI Desktop and "clear credentials" for "all sources"; this is under the Transform Data menu. 

Not sure if this helps.

I made some changes - not sure which worked!

domain admin: worked

 

Added domain user as local admin: didn't work (or was there some delay?)

Real SQL server name was vanguard2, so I used that at first for this SCCM power bi dashboard. Then, as we retained the original server name alias for older applications when we upgraded the server a couple of years ago, I decided to use that name 'VANGUARD' for the data connection. deleted the credentials, then it worked too.

could it be related to SPN's?

actually, when i say it worked, it stalled at a new error - my data coming from SCCM for malware has multiple records with the same data (appears to be a malware ID to name list)

 

 

 

Run as Admin worked for me.

Vladimir

Helped me, thank you 🙂

SiWill2017
Frequent Visitor

I am having issues connecting to our SQL server, our CRM is RDB Pro Net, does anyone use the same CRM and had issues connecting to the database?

 

Thanks.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.