Solved

VB6 and Oracle 9.2/10g

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now