Search code examples
sql-servervb.netoracleconnection-stringoledb

Cannot connect Oracle database in code but ok with SSMS


I'm developping a small application which have to connect on an Oracle Database.

With SSMS no problem. So i get the connection string from the properties :

Data Source=myserver;User ID=test;Password=test;Unicode=True

When I try to connect with VB.NET with Framework 4.5 :

Public testdb As New OleDbConnection("Provider=SQLOLEDB;Data Source=myserver;User ID=test;Password=test;Unicode=True")
testdb.Open()

I get the following error :

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. Attribute Invalid connection string

Thanks for your help


Solution

  • Changing provider to msdaora solved the issue.

    Thanks to dean for the solution.