can't load OCI.DLL

  • Thread starter news.microsoft.com
  • Start date
N

news.microsoft.com

Hello,

Another issue has risen after installing Visual Studio 2005. When I use
OracleClient with ASP.NET v1.1 I receive an error stating it can't load
OCI.DLL.

This has never been a issue before so I assume that it is a result of the
new version of VS. Doe's anyone know a fix for this problem?

Thanks,
Bryan
 
K

Ken Cox [Microsoft MVP]

That's usually a problem with the Oracle client or permissions.

1. Make sure the ASPNET account has sufficient permissions in the Oracle
folder.
2. Confirm the version of the Oracle client is 8.1.7 or later.
3. Check the connection string is correct.

Use Oracle With ADO.NET
Access Oracle databases from your .NET apps.
http://www.fawcette.com/vsm/2003_01/magazine/features/beauchemin/

Here's a quote:

"Once you install the .NET data provider of your choice and an Oracle client
if
necessary, you need to ensure that the current user has access to
directories
where the client software resides. Later versions of the Oracle client
protect
the client libraries with a discretionary access control list (DACL). If
you're
using ASP.NET, you must also ensure that the appropriate "Web server users"
(usually the user named ASPNET who runs the ASP.NET worker process) can
access
the client. Because ASPNET has only ordinary user privileges and not
administrator privileges, you need to add ASPNET to the Access Control List.
If
the ASPNET user doesn't have access, you'll receive a message such as
"Cannot
load OCI.dll" or "ORA-12154 TNS: could not resolve service name."


use that DLL.
 
S

sluggy

Bryan,
as Ken said, make sure the ASPNET user has sufficient rights. We have found that you need to assign
the rights from the root Oracle folder, just doing the /bin folder will not do the trick, obviously
oci.dll loads stuff from outside the bin folder. If you get really keen you could use depends.exe to
examine the imports of oci.dll, and determine what it is loading and from where.

HTH,
sluggy
 
N

news.microsoft.com

In response to your suggestions

1. Make sure the ASPNET account has sufficient permissions in the Oracle
folder.
I gave the account full permissions and then I receive the following
error.
"Could not create an environment: OCIEnvCreate returned -1"

2. Confirm the version of the Oracle client is 8.1.7 or later.
I am using Oracle client 9.2

3. Check the connection string is correct.
The connection string works with a WinForms app that connects to Oracle.

I checked all of this before posting. I wasn't sure where to go from there
that is why I posted it to the newsgroup.

Thanks,
Bryan
 
N

news.microsoft.com

That was the problem thanks!!


sluggy said:
Bryan,
as Ken said, make sure the ASPNET user has sufficient rights. We have found that you need to assign
the rights from the root Oracle folder, just doing the /bin folder will not do the trick, obviously
oci.dll loads stuff from outside the bin folder. If you get really keen you could use depends.exe to
examine the imports of oci.dll, and determine what it is loading and from where.
 
Joined
Aug 7, 2006
Messages
2
Reaction score
0
I thought I replied to this post, maybe there's multiple threads with the same issue?

here it is again in case I didn't hit save before!



I too encountered this issue a couple of times and am not impressed by the lack of "solutions" out here on-line.

Many people have advised that this is a permissions error - as above.

In fact, they're 100% correct. I found that by applying Read/Execute permissions for ASPNET to the Oracle folder, it wasn't applying to ALL of the folders.

Go through the various subfolders and ensure the permissions have been replicated throughout. This solved the problem for me.

Hope this helps.
Graham.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top