• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • Last Modified:

code to validate Oracle Client tool is loading on pc

I am looking for a way to validate if the user has any version of Oracle client Tool loaded on their local PC on open of the Main Menu or the Startup screen.  There maybe multiple versions to consider.  My problem is that the file path contains the version of Oracle.  how do I work around this?

Any suggestions is greatly appreciated.

Thanks,

K
0
Karen Schaefer
Asked:
Karen Schaefer
  • 17
  • 13
1 Solution
 
slightwv (䄆 Netminder) Commented:
You can check the registry but that isn't 100% accurate.

The Instant Client doesn't write to the registry.
0
 
Karen SchaeferAuthor Commented:
not sure how to approach that.

K
0
 
slightwv (䄆 Netminder) Commented:
Approach what?  The instant client verification or the registry?

Also, except for the instant client, regular Oracle installs keep an inventory file in c:\program files\oracle

That folder is static across all versions.  At least for now.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
slightwv (䄆 Netminder) Commented:
You can check the registry but that isn't 100% accurate.

The Instant Client doesn't write to the registry.
0
 
slightwv (䄆 Netminder) Commented:
Approach what?  The instant client verification or the registry?

Also, except for the instant client, regular Oracle installs keep an inventory file in c:\program files\oracle

That folder is static across all versions.  At least for now.
0
 
slightwv (䄆 Netminder) Commented:
Approach what?  The instant client verification or the registry?

Also, except for the instant client, regular Oracle installs keep an inventory file in c:\program files\oracle

That folder is static across all versions.  At least for now.
0
 
Karen SchaeferAuthor Commented:
okay you keep sending the same response multiple times.
0
 
slightwv (䄆 Netminder) Commented:
Sorry.  On mobile and it is messing up.
0
 
Karen SchaeferAuthor Commented:
"Also, except for the instant client, regular Oracle installs keep an inventory file in c:\program files\oracle"

Do you mean to do a chkDir for a particular file?
0
 
slightwv (䄆 Netminder) Commented:
Not exactly sure what you are needing.  The subject of the question mentioned 'code'.  I assumed you were writing some program and needed to verify the install of some part of the Oracle client.

The Oracle client has many pieces that may or may not be installed.

What are you needing?
0
 
Karen SchaeferAuthor Commented:
I need to look on each users pc to verify if they have a version of Oracle Client Tool.  to run a connection string to an Oracle database.  To prevent an error message - Provider not found....

K
0
 
slightwv (䄆 Netminder) Commented:
Then you need to verify specific drivers in the client are installed.  For example, ODBC.

Are you wanting to do this automated or manually?

Automated you will need to write code or a script to look in the inventory file.

Manually, just run the Oracle Installer and look for what is installed.
0
 
Karen SchaeferAuthor Commented:
strange that you say that I just found the following code and attempting to test it now.
Option Explicit
Public OracleConn As ADODB.Connection
Public User_Id_Conn As ADODB.Connection
Public strUID As String
Public strPWD As String
Public Const PRD_ORACLE_ENV As String = "Name of Instance"

Sub Main(Batch_Interactive As String, Oracle As Boolean)

Dim isInProduction As Boolean
Dim SQL As String
Dim SQL_RS As ADODB.Recordset

On Error GoTo ErrStartConnection

Set OracleConn = CreateObject("ADODB.Connection")

'Build the correct connection string for Oracle
OracleConn.ConnectionString = "DRIVER={Oracle ODBC Driver};UID=user name;PWD=password;" _
& "DBQ=" & PRD_ORACLE_ENV & ";Server = server name ;"
OracleConn.Open

Exit Sub
ErrStartConnection:

'put your checking here

End Sub

Open in new window

0
 
slightwv (䄆 Netminder) Commented:
I suppose if you try to use the driver and it works, then it is installed.

That is one way.
0
 
slightwv (䄆 Netminder) Commented:
However what if the Oracle client is installed but the ODBC driver isn't?
0
 
Karen SchaeferAuthor Commented:
the ODBC driver is not need - I will be using DSN-Less connection string.

I unsure what the call string should have.

Sub Main(Batch_Interactive As String, Oracle As Boolean)


I want to call this function on load of the Startup screeen. Batch_Interactive As String what should this be.?

K
0
 
slightwv (䄆 Netminder) Commented:
Doesn't the dsnless connection still need the odbc drivers?
0
 
Karen SchaeferAuthor Commented:
no is is set within the connection string - this way I do no have to load an ODBC Driver on everyones PC.

k
0
 
slightwv (䄆 Netminder) Commented:
Then what are you wanting to check is installed?

I'm starting to get a little confused.
0
 
Karen SchaeferAuthor Commented:
Here is my latest attempt, however, not sure how to activate the code - Unsure what to pass as the string value  and/or the boolean value.
Function Main(Batch_Interactive As String, Oracle As Boolean)

Dim isInProduction As Boolean
Dim SQL As String
Dim SQL_RS As ADODB.Recordset

On Error GoTo ErrStartConnection

Set OracleConn = CreateObject("ADODB.Connection")

'Build the correct connection string for Oracle
     OracleConn.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(COMMUNITY= tcp.world)" & _
             "(PROTOCOL=TCP)(Host=ussedb16.ca.*****.com)(Port=1521)))(CONNECT_DATA=(SERVICE_NAME=db1.bdatadb)));" & _
             "User Id=********;Password=********;"
OracleConn.Open

Exit Function
ErrStartConnection:
    Call _
        MsgBox("The Oracle Client Tool is not currently Installed. Please download the latest Version of Oracle Client Tool from software Express.", _
        vbCritical, "Oracle Client Tool")

End Function
Public Function OpenNewSR()

Open in new window

0
 
slightwv (䄆 Netminder) Commented:
Not sure you need those parameters.

You also switched drivers from odbc to oledb.

Like I mentioned above, that code will only tell you if the oledb drivers are installed.  The client might be installed and missing that specific data provider.
0
 
Karen SchaeferAuthor Commented:
ok I just found another bit of code I am going to text.

found on EE:

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_22856864.html?sfQueryTermInfo=1+10+30+spliterrtext

thanks for your input.

K
0
 
slightwv (䄆 Netminder) Commented:
That looks like it searches the registry for the keys like I mentioned before.

You still haven't mentioned what specific piece of the client you are looking for.

I mentioned before, the client has many pieces and not all of them are installed.  You need to know what part you need.
0
 
Karen SchaeferAuthor Commented:
I am not sure what piece I am looking - I just need to validate that Oracle Client Tool in some form does exists on the current user's PC.  I think this code does the trick.  I need to do further testing on a machine that does not have the tool on it.

Again thanks for your time and efforts.

Karen
0
 
slightwv (䄆 Netminder) Commented:
You stated above: To prevent an error message - Provider not found....

To prevent this error you need a specific data provider.  Just checking that the client is installed will not be enough.

The data providers are optional on the install.
0
 
Karen SchaeferAuthor Commented:
any ideas on how to specify the Provider?

k
0
 
slightwv (䄆 Netminder) Commented:
you either need to know where in the registry Oracle places that information for each release or look inside the inventory file.

Or as you have been posting code examples: try to use the driver you need.  the issue there is what I have mentioned:  the client might be installed and just missing the provider.

It boils down to exactly what you need to do in those situations.
0
 
Karen SchaeferAuthor Commented:
Ok after checking one of our Oracle Guru- he suggested that we look for the Software\Oracle\OracleHome or some wildcard version of that within the RegEdi file.

Got any ideas on how to modify the code to look for that Oracle*Home* file?

Karen
0
 
slightwv (䄆 Netminder) Commented:
That isn't a file.  It is a registry key.

Again, that will likely not tell you if the drivers you need are installed.
0
 
Karen SchaeferAuthor Commented:
Thanks for the input, however, I abandoned this approach to complex for my needs.  My time will not allow me to pursue this at this time.

Thanks again for all your input.

Please award points for his time.

K
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 17
  • 13
Tackle projects and never again get stuck behind a technical roadblock.
Join Now