Solved

VB6 and Oracle 9.2/10g

Posted on 2011-03-08
2
1,219 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

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Row_number in SQL 6 45
return value in based on value passed 6 37
Excess Redo 3 32
Visual Basic 6: Code needed for TripleDES Encryption/Decryption 13 33
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to recover a database from a user managed backup

740 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