0

I have an old VB.Net application which requires the Oracle client to be installed and uses the tnsnames.ora file on the target machine.

I have a field in My.Settings defined as the following:

Provider=MSDAORA;Data Source=MySourceName;Persist Security Info=True;Password=MyPass;User ID=MyUser

Is there a way to have it connect directly?

I tried changing the connection string using EZCONNECTION, but get an error:

Data Source=10.1.1.12:1521;Persist Security Info=True;User ID=MyUser;Password=MyPass;Unicode=True

Error message on compile:

An OLE DB Provider was not specified in the ConnectionString. 

I am using Visual Studio 2019.

5
  • Have you looked at ODP.NET? Commented Sep 2, 2021 at 12:45
  • 1
    Provider MSDAORA is the ancient, deprecated driver from Microsoft. It exists only for 32-bit. Your question is not clear, you ask "Oracle Connection string without installing Oracle client" but then you write "an application which requires the Oracle client to be installed" Commented Sep 2, 2021 at 12:52
  • @WernfriedDomscheit The application originally requires it, but as you say it is ancient, and I don't normally work with Oracle connections, I don't know if there's a way to not have to install it like using a MS SQL provider which already comes with Win 10. Commented Sep 2, 2021 at 13:16
  • @WSC I installed the OPD.NET for VS 2019. I tried using the ODP.NET, Managed Driver with a basic connection type, but get the error message: ORA-12514: TNS:listner does not currently know of the service requested in connect descriptor. Same with Unmanaged. I am assuming that the Data Source name is the same as the Service Name. Commented Sep 2, 2021 at 13:42
  • "MS SQL provider which already comes with Win 10." You will notice that MS SQL Provider and Win 10 come from the same company. Mickysoft may include their db access driver with their OS, but that does not change the fact that they are two separate and distinct entities. If you want to access and Oracle database, you are going to have to install the appropriate drivers. Period. Full stop. There's a lot more to actually accessing a database than simply specifying connection credentials. Commented Sep 2, 2021 at 13:45

1 Answer 1

2

For connecting to an Oracle database, I recommend you install ODP.NET from NuGet. This removes any dependency on a local Oracle installation.

You can then follow the installation instructions which are included. The syntax is more or less the same as SqlCommand but you reference OracleCommand instead.

Sign up to request clarification or add additional context in comments.

1 Comment

I think providing a DLL as part of your executable is stretching the definition of "local Oracle installation"...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.