1 Introducing Oracle Objects for OLE

This chapter introduces Oracle Objects for OLE (OO4O).


Oracle Database 11g Release 2 (11.2) is the last database version that supports Oracle Objects for OLE. Oracle Database versions, which are released after Oracle Database 11g Release 2 (11.2), will not support Oracle Objects for OLE. You can continue to use Oracle Objects for OLE with existing Oracle Database versions that are covered under the lifetime support policy of Oracle.

This chapter contains these topics:

Overview of Oracle Objects for OLE

Oracle Objects for OLE (OO4O) allows you to access data stored in Oracle databases with any programming or scripting language that supports Microsoft COM Automation and ActiveX technology. This includes Visual Basic, Visual C++, Visual Basic for Applications (VBA), IIS Active Server Pages (VBScript and JavaScript), and others.

Figure 1-1 illustrates the software layers that comprise the OO4O product.

Figure 1-1 Software Layers of OO4O

Description of Figure 1-1 follows
Description of "Figure 1-1 Software Layers of OO4O"

OO4O provides the following:

Oracle Objects for OLE In-Process Automation Server

The OO4O In-Process Automation Server is a set of COM Automation Objects for connecting to Oracle databases, executing SQL statements and PL/SQL blocks, and accessing the results.

Figure 1-2 illustrates the object model that comprise the OO4O product.

Figure 1-2 Automation Objects

hierarchy diagram starting with OraSession
Description of "Figure 1-2 Automation Objects"

Unlike other COM-based database connectivity APIs, such as Microsoft ActiveX Data Objects (ADO), the OO4O Automation Server was created specifically for use with Oracle databases. It provides an optimized API for accessing features that are unique to the Oracle database and are otherwise cumbersome or unavailable from ODBC or OLE DB components.

OO4O provides key features for accessing Oracle databases efficiently and easily in environments ranging from the typical two-tier client/server applications, such as those developed in Visual Basic or Excel, to application servers deployed in multitiered application server environments such as Web server applications in Microsoft Internet Information Server (IIS) or Microsoft Transaction Server (MTS).

Features include:

  • Oracle 11g is grid enabled, allowing developers to take full advantage of grid support without changes being required to existing code.

  • Tunable client-side, scrollable and updatable cursors for easy and efficient access to result sets of queries.

  • PL/SQL support for execution of PL/SQL anonymous blocks and stored procedures. This includes support for the Oracle data types, such as PL/SQL cursors, that are needed for parameters of PL/SQL stored procedures.

  • Support for array fetches, updates, and inserts resulting in reduced network round-trips.

  • Connection pooling to allow development of scalable middle tier application components, such as IIS Active Server Pages, that use and serve dynamic content stored in Oracle databases.

  • Support for COM+ and Microsoft Transaction Server (MTS) co-ordinated transactions.

  • Seamless access to instances of advanced Oracle data types:

    • Object references (REFs)

    • Object instances (Objects)

    • Nested tables

    • VARRAYs

    • BLOBs, CLOBs, NCLOBs, and BFILEs

  • XML generation.

  • Full support for advanced queuing.

  • Support for publishing, detecting, and subscribing to database events.

  • Support for asynchronous processing of SQL statements and PL/SQL blocks.

  • Easy to use interface for describing schema objects.

  • The Oracle code wizard for stored procedures, which automatically generates OO4O code to execute PL/SQL or Java stored procedures.

  • Thread safety, allowing safe access to automation objects in multithreaded environments.

Oracle Data Control

Oracle Data Control is an ActiveX control that is designed to simplify the exchange of data among an Oracle database and visual controls such as edit, text, list, and grid controls in Visual Basic and other development tools that support custom controls.

A data control enables you to perform most data access operations without writing any code. To create a dynaset with a data control, set the Connect, DatabaseName, and RecordSource properties, and execute the Refresh command.

A data control enables you to bind it to other controls that display a field, a record, or multiple records of the underlying dynaset. When record movement occurs, data in bound controls stay synchronized with the current record of the dynaset. If a user changes data in a control that is bound to a data control, the changes are automatically reflected in the underlying dynaset and database.

The Oracle Data Control is compatible with the Microsoft data control included with Visual Basic. If you are familiar with the Visual Basic data control, learning to use Oracle Data Control is quick and easy. Communication between data-aware controls and a Data Control is governed by a protocol specified by Microsoft.

Oracle Objects for OLE C++ Class Library

The Oracle Objects for OLE C++ Class Library is a collection of C++ classes that provide programmatic access to the OO4O Automation server. Although the class library is implemented using OLE Automation, neither the OLE development kit nor any OLE development knowledge is necessary to use it. This library helps C++ developers avoid writing COM client code to access the OO4O interfaces.

In addition to the object classes, the class library provides a bound class, which allows controls such as text and list boxes to be linked directly to a field of a dynaset (columns of a table in the database). The bound class supports late, run-time binding, as is available in Visual Basic. The Oracle Objects for OLE C++ Class Library is supported for Microsoft Visual C++ and the Microsoft Foundation Classes for the bound class.

See Also:

Oracle Objects for OLE C++ Class Library Developer's Guide available as online help

Required Setups

This section discusses the required setups for using Oracle Objects for OLE.


Oracle Objects for OLE can be installed in multiple Oracle homes, starting with Oracle Database 10g. However, being a COM component, only one instance can be active on the computer. This means that the current (latest) installation renders the previous one inactive. You can switch Oracle homes by using the Oracle installer.

System Requirements


Oracle Objects for OLE is not supported on Windows x64 operating systems.

The following system requirements are necessary to install Oracle Objects for OLE:

  • Windows Operating System:

    • 32-bit: Windows 7 (Professional, Enterprise, and Ultimate Editions), Windows Vista (Business, Enterprise, and Ultimate Editions), Windows Server 2008 (Standard, Enterprise, Datacenter, Web, and Foundation Editions), Windows Server 2003 R2 (all editions), Windows Server 2003 (all editions), or Windows XP Professional Edition.

      Oracle supports 32-bit Oracle Objects for OLE on x86, AMD64, and Intel EM64T processors on these operating systems.

  • A local or remote Oracle database (Oracle9i Release 2 or higher)

  • Oracle Client. Oracle Universal Installer ensures that the RSFs are installed as part of the OO4O installation.

  • The OO4O automation server requires an application that supports COM Automation such as:

    • Microsoft Visual Basic

    • Microsoft Excel

    • Microsoft Access

    • Microsoft Internet Information Server (IIS)

    • Borland Delphi

Other Requirements

The following other requirements may be necessary:

  • The Oracle Data Control requires Visual Basic.

  • The Oracle Objects for OLE C++ Class Library requires Microsoft Visual C++ Version 6.0 or later.

  • The OO4O Code Wizard requires Visual Basic 6. Visual Basic 6 must be installed before installing the Code Wizard.

  • The Oracle In-Process Server Type library (oipVER.tlb) must be referenced when an OO4O Visual Basic project is developed.

    To do this, select References from the Project menu (VB 5.0/6.0) and check the box next to the Oracle In-Process Server 5.0 Type Library, which should be pointing to the ORACLE_BASE\\ORACLE_HOME\bin\oipVER.tlb file. See "Using Oracle Objects for OLE Automation with Visual Basic" for detailed information.

See Also:

"Oracle Objects for OLE Redistributable Files" and "Troubleshooting" for further information on Oracle Objects for OLE requirements

Oracle Objects for OLE File Locations

As part of the OO4O installation, the following directories are created and contain the corresponding files:

  • ORACLE_BASE\ORACLE_HOME\OO4O - SQL scripts and constants file

  • ORACLE_BASE\ORACLE_HOME\OO4O\CPP - Libraries, include files, DLLs, and source for the class library

  • ORACLE_BASE\ORACLE_HOME\OO4O\CPP\MFC - Libraries, include files, and source for the MFC Bound Class Library



  • ORACLE_BASE\ORACLE_HOME\OO4O\VB\SAMPLES\QT - Visual Basic Quick Tour guide


  • ORACLE_BASE\ORACLE_HOME\OO4O\codewiz - OO4O Code Wizard samples

Component Certifications

Find the latest certification information at My Oracle Support (formerly OracleMetaLink):


You must register online before using My Oracle Support. After logging into My Oracle Support, select Product Lifecycle from the left column. From the Products Lifecycle page, click Certifications. Other Product Lifecycle options include Product Availability, Desupport Notices, and Alerts.

Oracle Objects for OLE Redistributable Files

This section discusses files that can be redistributed or updated on a computer that belongs to an end user or a developer.

If you cannot guarantee that your end users have the current release of Oracle Objects for OLE installed on their computers, you need to redistribute specific files that are part of Oracle Objects for OLE along with your OO4O application. A typical scenario might be if OO4O is installed as a patch without use of Oracle Universal Installer.

Redistributable File Locations

Table 1-1 lists the Redistributable file locations with comments and further actions that are needed.

Table 1-1 Redistributable File Locations

Files Place in Directory Further Actions Comments



Execute the following from a command prompt:


regsvr32.exe oipVER.dll









Change VER to the current version.



Edit for the correct ORACLE_HOME location and HOMEID on your computer. Execute the following from a command prompt: drive:\path>


File provided to register OO4O configuration information.




This message file is language-specific. oipus.msb is the English version, and oipja.msb is the Japanese version.


(for Microsoft





For oradc.ocx, execute:

regsvr32.exe oradc.ocx drive:\path>

Distribute the files that correspond to the development software used in your application.

Additionally, ensure that the system requirements described in "Overview of Oracle Objects for OLE" are met.

You must also distribute the files from the following list that correspond to the development software you used to build your application:

  • oraclm32.dll (for Microsoft Visual C++)

  • oradc.ocx

Updating Files and Registrations

The oo4oparm.reg file is provided to register OO4O configuration information. Review this file and edit it as necessary to reflect the correct ORACLE_HOME location and HOMEID on your computer. To register oipVER.dll and enter the OO4O configuration information for oo4oparm.reg in the registry, execute the following from a command prompt:

drive:\path> regsvr32.exe oipVER.dll

drive:\path> oo4oparm.reg

The message file oiplang.msb should also be provided and copied to the ORACLE_BASE\ORACLE_HOME\oo4o\mesg directory. The message file is specific to a language. For example, oipus.msb is the English version and oipja.msb is the Japanese version.


Oracle Data Control (oradc.ocx) must be registered to function. The OLE Control Extension (OCX) can be registered by executing the following at the command prompt:

drive:\path> regsvr32.exe oradc.ocx