cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thymallus Frequent Visitor
Frequent Visitor

Re: Oracle connection error: Object reference not set to an instance


This is not the case with 64-bit PBI desktop, however. It seems to be a unique snowflake in a sense, that it does not use PATH for locating the driver. I believe it requires the driver to be installed in GAC - basically a directory for shared DLLs and other assemblies located under %WINDIR%\Microsoft.NET\assembly. When Oracle universal installer prompts whether to place the driver in GAC and configured on machine level, select yes. If using Xcopy version, use configure.bat in Oracle install directory to place the driver there.

 

While the above holds true for the version from Microsoft Store, it appears the version downloadable from https://www.microsoft.com/en-us/download/details.aspx?id=45331 works fine (both February 2018). So finally, I have the driver installed from Xcopy as described in my previous message and I'm able to connect to the Oracle DB in 64-bit PBI Desktop, too.

My take on the situation is that MS Store version disregards PATH and goes straight to GAC and fails. The "direct download" searches PATH first and then goes to GAC - if I remove my ODAC directory from PATH, this one throws the same ‘Object reference...' exception.

If anyone has managed to get the 64-bit version from Microsoft Store working with Oracle, it would be interested to know how.

ToddChitt Member
Member

Re: Oracle connection error: Object reference not set to an instance

Curious to see if anyone has a definitive resolution to this issue. Here is my scenario:

  • Using laptop A with Oracle drivers installed, I connect VPN to client system
  • I open Power BI x64 and open a PBIX model. I can refresh data connected to the client's Oracle database server, using Database level credentials.

All is good so far.

  • Using laptop B with same version of Oracle drivers installed, I connect to same VPN using same credentials.
  • The TNSNAMES.ORA file is copied to appropriate place on machine B
  • I open the same Power BI PBIX file, but this time a data refresh fails.
  • I assume it is due to the fact that the Oracle credentials are not saved.
  • I start a clean, new Power BI model
  • I get into Data Source Settings and delete any and all Oracle connections
  • Starting fresh, I create a connection to Oracle, specify the same server, user and password.
  • I get the error: "An error happened while reading data from the provider: 'Object reference not set to an instance of an object' "

 

Any help would be appreciated. Thanks in advance.

anitaberg Regular Visitor
Regular Visitor

Re: Oracle connection error: Object reference not set to an instance

Hi! I have been experiencing with this ODAC install and related issues. I have a complete Oracle test environement on my virtual machine where I am trying to install ODAC. I have the Oracle database server and OBIEE (Oracle BI, with servers).

 

Due to this I had a client_1 in C:\app\client\<windowsuser>\product\12.2.0 folder.

 

1. The first installation I installed odac in a client_2 folder. Result: Power BI did still complain about not having ODAC installed

 

Then I found a thread https://community.powerbi.com/t5/Desktop/Unable-to-connect-using-Oracle-database-even-after-ODAC-ins... saying that installing on the same client would solve issue 

 

2. Changed the path for ODAC install to client_1

 

Then I no longer got the error abot having to install odac client, but the error Details: "An error happened while reading data from the provider: 'Object reference not set to an instance of an object.'"

 

Found some stackoverflow saying that this issue is mixing 32 bit and 64 bit, and also Oracle documentation does not recommend installing onto existing oracle home/folder.

 

I have not installed using x_copy so far. But for the last installation I did select machine level for .NET I have now the store version of Power BI, but will install with the other downloadable.

 

QUESTION: What should I do to get this to work, having the downloadable version instead? Go back to client_2 folder installation, or use X_copy for ODAC to install instead? Where do you install ODAC?

anitaberg Regular Visitor
Regular Visitor

Re: Oracle connection error: Object reference not set to an instance

Figured it out now: I kept the installation with having ODAC installed to client_1. I de-installed the store version and installed the download version. I new error related to TNS names Oracle: ORA-12541: TNS:no listener" when I connected to the computername as server name in Power BI. I checked the tnsnames.ora in C:\app\client\anitaberg\product\12.2.0\client_1\Network\Admin and then tested to log on as localhost as server name. Got then the error Details: "Oracle: ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA" , then I used the name of the service (if it is called that) ORCL as server, and then Power BI was able to show the three of tables.

 

 

ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )

ataft Frequent Visitor
Frequent Visitor

Re: Oracle connection error: Object reference not set to an instance

I have the same issue. PBI Desktop works fine but can't get past the error when setting up the data source in the gateway.

Highlighted
trojii Frequent Visitor
Frequent Visitor

Re: Oracle connection error: Object reference not set to an instance

Thank you! I had the same error ("Object reference not set to an instance").

In my case it didn't work with Power BI downloaded from Microsoft Store either.

I was googling hard but couln't find any download link or then I was redirected to the store. I usually had the web version downloaded but this options seems to be removed for updating. So thanks for the link!

 

For the record and people having the same troubles I had:

I was using Power BI from the Microsoft Store and was trying to connect to an oracle database.

However, I had the error "The recommended provider ('Oracle.DataAccess.Client') is not installed."

So I can confirm:
- download ODAC121024_x64.zip from https://www.oracle.com/technetwork/database/windows/downloads/index-090165.html (64bit in my case)

- unzip and run the setup.exe (I had it run with default settings)

- Then, if you are able to connect but get the object reference error, deinstall Power BI Microsoft Store version, download from the web and run this version.

- trying to connect again to my oracle database. What a surprise, it worked!

 

Best,

Trojii

fifkafifka New Member
New Member

Re: Oracle connection error: Object reference not set to an instance

Trojii's solution worked for me. I had windows store powerbi desktop, odac 64bit and odac 32bit installed and still couldn't connect to oracle db. i uninstalled store app, installed the web version and everything started to work.