Oracle Objects for OLE Release 9.2 Part Number A95895-01 |
|
In order to connect to an Oracle database with the OO4O Automation Server, you must first create an instance of the server. In Visual Basic (VB), this is usually done by calling the CreateObject method, although the NEW keyword can also be used.
You can use the Visual Basic CreateObject method with two OO4O server objects. The interface of either of the following objects can provide access to OO4O and enable a connection to the Oracle database.
The CreateObject method uses the ID of the component and object as arguments.
Obtaining an OraSession Object
The script below demonstrates how to obtain an OraSession object in Visual Basic. OO4OSession is the object variable that holds an instance of the OraSession object.
Dim OO4OSession as Object
Set OO4OSession = CreateObject(“OracleInProcServer.XOraSession")
or
Dim OO4OSession as OraSession
Set OO4OSession = New OraSessionClass
or
Dim OO4OSession as New OraSessionClass
The following example demonstrates how to obtain an OraSession object in IIS Active Server Pages.
<OBJECT RUNAT=Server SCOPE=APPLICATION ID=OO4OSession PROGID="OracleInProcServer.XOraSession">
</OBJECT>
OracleInProcServer.XOraSession is the version independent program ID for OO4O that the Oracle client installation program registers in the Windows registry. It is the symbolic name for a globally unique identifier (CLSID) that identifies the OO4O component.
Obtaining an OraServer Object
You can also use the OraServer object interface for accessing the OO4O Automation Server.
Dim OO4OServer as Object
Set OO4OServer = CreateObject("OracleInProcServer.XOraServer")
Now you can connect to the Oracle Database. See Connect to Oracle Database.
|
Copyright © 1994, 2002 Oracle Corporation. All Rights Reserved. |
|