Error 0x80040e4e: OLE DB or ODBC [Exception from HRESULT]

Manually changing the data type of columns should help

Reading time icon 5 min. read

Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team Read more

Key notes

  • The error code 0x80040e4e occurs if there is a conflict between the data type of the columns autodetected in PowerBI.
  • Manually changing the data type and deleting the data source cache will help fix the error code.

If you are here, you have encountered the error code 0x80040e4e with the following exception OLE DB or ODBC [Exception from HRESULT] when loading or refreshing an existing table in the PowerQuery on the PowerBI desktop.

Though the message itself does vaguely not offer any insight on how to resolve it, you can easily fix the error code 0x80040e4e by implementing the solutions covered in this article. 

Why do I get the 0x80040e4e error code in PowerBI? 

You will encounter the error 0x80040e4e: OLE DB or ODBC [Exception from HRESULT] in PowerBI due to one of the following reasons: 

  • Duplicate table in Power Query – If there is a duplicate table in PowerQuery, the error code in question is likely to show up. 
  • Special characters – Incompetency of PowerBI to handle the special characters in the database and create unusual encoding also causes the loading to fail with the error. 
  • Conflicting data type – If there is a conflict between the data type in the source with the data type of the column, the error code 0x80040e4e is likely to show up.
  • Unnecessary relationships – This error may also occur if PowerBI auto-detects a needless relationship between CoE Settings and Environment.

How do I fix the error code 0x80040e4e in PowerBI?

1. Change the data type of the column

  1. Switch to the Home tab from the top menu bar and click to expand the Edit Queries drop-down followed by Edit Queries from the PowerBI ribbon to access the Power Query Editor window. 0x80040e4e
  2. Now, select the column for which you want to change the data type and click the left corner of the column header. 0x80040e4e
  3. Select the suitable data type for the current column from the list of supported data type that appears. 0x80040e4e
  4. A confirmation pop-up window to change the column type will pop up. Click the Replace Current button.

Generally, when a tabled gets loaded from a data source in PowerBI, the data type of the column gets detected automatically. 

However, in some cases, there may be a contradiction when PowerBI applies the incorrect data type, especially for the columns with date data type causing the error 0x80040e4e: OLE DB or ODBC [Exception from HRESULT] in PowerQuery. Hence, changing the data type of the affected column should suffice.

2. Delete unnecessary relationships 

  1. Cancel the table load in PowerBI such that Power BI will now load without any values. 
  2. Switch to the Modeling tab from the top menu bar and choose the Manage Relationships option from the ribbon. 0x80040e4e
  3. Look for the relationship between Environments and CoE Settings in the list of all relationships and press the Delete button located at the bottom. 
  4. Now Save and Close the dialog box and re-load the query.

The query should now load correctly without encountering the error 0x80040e4e in PowerQuery.  

3. Remove duplicate columns from the table 

  1. Open the table in question and click the topmost cell present before the column headers. 
  2. Select the Remove duplicates option from the drop-down menu that appears. 0x80040e4e

Deleting the duplicates in multiple columns across the table will help get past the error code 0x80040e4e in PowerBI. 

4. Clear the data source cache 

  1. Launch the PowerBI desktop and choose File from the top ribbon. 
  2. Choose Options and settings from the left navigation panel, followed by Options from the right sidebar. 
  3. Select Data Load from the left panel of the new window. 
  4. Look for the Clear Cache button under the Data Cache Management Options and Q&A Cache Options section and press the OK button. 0x80040e4e
  5. After you perform the above steps, the Currently used value will be set to 0 bytes. Now re-establish the connection with the required data sources and refresh the data query editor.

5. Clear Global Permissions 

  1. Access the File tab located on the ribbon in PowerBI Desktop. 
  2. Choose Options and settings from the left sidebar, followed by Data Source settings from the right. 0x80040e4e 
  3. In the Data Source settings window, enable Global Permissions on the top, select the BI Connector from the list of data sources, and press the Clear Permissions button at the bottom.  
  4. After you clear the PowerBI cache and data source settings, close all the instances of the Power BI desktop and re-launch it.

Cleaning the global permissions will clear the login credentials forcing you to set up a fresh connection. This will help fix the 0x80040e4e: OLE DB or ODBC [Exception from HRESULT] error when you refresh the table.

That’s pretty much it! You can try the methods listed in this guide to eliminate the error 0x80040e4e : OLE DB or ODBC [Exception from HRESULT] in PowerBI. 

You may also want to fix the PowerBI data source credentials if they are greyed out for you. 

Which of the tricks mentioned in this article worked in your case? We are curious to find out! 

More about the topics: Power BI