Solved

VB6 and Oracle 9.2/10g

Posted on 2011-03-08
2
1,221 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This video shows how to recover a database from a user managed backup
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

728 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