installed ODP.NET but get error 'oraoledbpus10.dll: the specified module could not be found'


I'm trying to get ODP.NET to work but came up with the above error when trying to connect through code (VB.NET). My Connection string is below.

I am connecting to an Oracle 10g database on a server. I downloaded from Oracle: Oracle 10g Release 2 ODAC and Oracle Developer Tools for Visual Studio .NET. The version is 10.2.020.

I think one of the problems might be the fact that the default oracle home is currently in the folder E:\oracle\ora92 but the ODP.NET created a new oracle home in E:\oracle\product. So, I saw something on the release notes saying this would cause a problem... but i'm not sure how to fix

Can anyone help me get this working? (humm, i guess the way i'm connecting below won't work anyway either, that's just for a standard oledb connection i guess?)

Thanks, Aiden
strOracleServer = "Provider=OraOLEDB.Oracle;Data Source=ORCL1;User Id=MANUALTASKS;Password=MANUALTASKS; Min Pool Size=10;Connection Lifetime=120;Connection Timeout=120;Incr Pool Size=5;Decr Pool Size=2"

cnnADO = New OleDbConnection(strOracleServer)

Open in new window

Who is Participating?
The reason for that error is that you are using the OLEDB objects.

You should be using OracleConnection object
slightwv (䄆 Netminder) Commented:
I can't remember id ODAC installes the OLEdb drivers or not but if you want to use the ODP.Net drivers try foe following connection string:

strOracleServer ="User Id=MANUALTASKS;Password=MANUALTASKS;Data Source=ORCL1;")

also make sure you add references to:
Check the connection strings for ODP.NET
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

AidenAAuthor Commented:
yeah have all that actually, accidentally used the wrong connection string... but when i use the correct one, I now get the error

An OLE DB Provider was not specified in the ConnectionString.  An example would be, 'Provider=SQLOLEDB

(also, I have this feeling that the oracle home thing will be an issue even if I get the connection part right?)
slightwv (䄆 Netminder) Commented:
>>An OLE DB Provider was not specified in the ConnectionString

Check the project's references.  Make sure you are referencing the ODP classes and not the OLEDB ones.
AidenAAuthor Commented:
well i have to say i'm surprised but it's working. I was expecting that to be much more painful!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.