Determine if Oracle client installed?

G

Guest

Hi;

The class OracleClient is always installed - it's part of .NET. However, if
Oracle's client software is not installed on a a system, then OracleClient
can not do anything.

How can I determine of Oracle's client software is installed and working so
we can not offer Oracle as a choice if it is not installed?

Also, any idea if there is a registry value that will let me find the
tnsnames file?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
W

WenYuan Wang

Hi,

As far as I know, there should be some information in Registry.
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE

I noticed there are some posts related to this issue. Hope this helps.
http://groups.google.com/groups/search?q=client+HKEY_LOCAL_MACHINE\SOFTWAR
E%5CORACLE&start=10&sa=N&hl=zh-CN&lr=&ie=UTF-8&oe=UTF-8&
http://groups.google.com/group/comp.databases.oracle.server/browse_frm/threa
d/a4087dfb559a6361/2dd636cb97ac1be1?lnk=st&q=client+HKEY_LOCAL_MACHINE%5CSOF
TWARE%5CORACLE&rnum=11&hl=zh-CN#2dd636cb97ac1be1

Also, I appreciate for any better ideas for Dave.
Sincerely,
Wen Yuan
 
D

David Browne

"WenYuan Wang" said:
Hi,

As far as I know, there should be some information in Registry.
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE

I noticed there are some posts related to this issue. Hope this helps.
http://groups.google.com/groups/search?q=client+HKEY_LOCAL_MACHINE\SOFTWAR
E%5CORACLE&start=10&sa=N&hl=zh-CN&lr=&ie=UTF-8&oe=UTF-8&
http://groups.google.com/group/comp.databases.oracle.server/browse_frm/threa
d/a4087dfb559a6361/2dd636cb97ac1be1?lnk=st&q=client+HKEY_LOCAL_MACHINE%5CSOF
TWARE%5CORACLE&rnum=11&hl=zh-CN#2dd636cb97ac1be1

Also, I appreciate for any better ideas for Dave.

That method really assumes too much about the footprint of the Oracle client
installer. For instance, if the Oracle Instant Client is installed, you
won't have that registry value. Anyway, you don't really care if there is
some Oracle client installed, you care if there is an Oracle client
installation that's usable by System.Data.OracleClient.

So I recommend that you use System.Data.OracleClient to determine if the
Oracle client is installed and available. If you try to open a connection
and the client is not installed, or the path is not set correctly, you will
get this message:

"System.Data.OracleClient requires Oracle client software version 8.1.7 or
greater"

The only other reliable way to determine if the Oracle client is available
is to manually load OCI.DLL using a P/Invoke call to LoadLibrary. But this
method requires elevated code access security.

David
 

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

Top