Solved

VB6 and Oracle 9.2/10g

Posted on 2011-03-08
2
1,216 Views
Last Modified: 2012-05-11
We have a VB6 application that access Oracle database
using 9.2 client.   When we try to run this application using a
10g client, we experience problems with database
connections getting dropped, application hangs, etc.

We'd prefer to use the 10g client, but we are not sure what
needs to be changed in order to get it to work.

Example below of logic we are using to create db connections
in app...
Set mvarSession = CreateObject("OracleInProcServer.xOraSession")

Set mvarConnection = Nothing
    Set mvarConnection = New RDO.rdoConnection
    sAltersession = "ALTER SESSION SET OPTIMIZER_MODE=RULE"
    With mvarConnection
        .Connect = "uid=" & sUserID _
                & ";pwd=" & sPassword _
                & ";DSN=" & sRemoteDatabase & ";"
        .CursorDriver = rdUseClientBatch
        .EstablishConnection rdDriverNoPrompt
        .Execute sAltersession
    End With

Open in new window

0
Comment
Question by:DoubleV47
  • 2
2 Comments
 
LVL 16

Accepted Solution

by:
HooKooDooKu earned 500 total points
ID: 35071616
Do you have the correct version of the Oracle InProc Server installed?

We've used the "Oracle InProc Server 2.3 Type Library" referenced by our VB project and use the OraSession and OraDatabase objects.

Dim WS as OraSession
Dim DB as OraDatabase
Set WS = CreateObject("OracleInProcServer.XOraSession")
Set DB = WS.OpenDatabase( DatabaseName, UserID & "/" & Password, ORADB_DEFAULT)
DB.ExecuteSQL("ALETER SESSION SET NLS_DATE_FORMAT = 'MM/DD/RRRR HH:MI:SS AM'")
0
 
LVL 16

Expert Comment

by:HooKooDooKu
ID: 35071656
BTW, to then open a record set...

We use the CreateDynaset() in OraDatabase.

For example, to get a read-only record set
Dim RS as OraDynaset
  set RS = DB.CreateDynaset(SQL$, ORADYN_READONLY)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question