Skip Headers
Oracle® Objects for OLE Developer's Guide
11g Release 2 (11.2) for Microsoft Windows

Part Number E17727-03
Go to Documentation Home
Go to Book List
Book List
Go to Table of Contents
Go to Index
Go to Feedback page
Contact Us

Go to previous page
Go to next page
PDF · Mobi · ePub

OriginalItem Method

Applies To

OraFields Collection


Returns the OraField object based on the original column name used in the SELECT statement in the dynaset. Not available at design time and read-only at run time.


set OraField = OraFields.OriginalItem(field_index)
set OraField = OraFields.OriginalItem(original_name)


The arguments for the method are:

Arguments Description
field_index Field index of the original column name.
original_name Original field name specified in the SQL statement.


This is property is useful when a SQL statement contains 'schema.table.col' as the Name of the field, and retrieves the field object specific to that original name.


The following example shows the use of the OriginalItem method. Copy and paste this code into the definition section of a form. Then, press F5.

Sub Form_Load ()
 'Declare variables
 Dim OraSession As OraSession 
 Dim OraDatabase As OraDatabase 
 Dim OraDynaset As OraDynaset 
 Dim OraFields As OraFields
 'Create the OraSession Object.
 Set OraSession = CreateObject("OracleInProcServer.XOraSession")
 'Create the OraDatabase Object by opening a connection to Oracle.
 Set OraDatabase = OraSession.OpenDatabase("ExampleDb", "scott/tiger", 0&)
 Set OraDynaset = OraDatabase.CreateDynaset("select scott.emp.deptno," & _
     "dept.deptno from scott.emp, scott.dept where dept.deptno = emp.deptno", 0&) 
 'Get the Field collection object
 Set OraFields = OraDynaset.Fields
 'get the original field object. Returns "scott.emp.deptno" 
 MsgBox OraField.OriginalName
 Set OraField = OraFields.OriginalItem(1)
 'Returns "dept.deptno" 
 MsgBox OraField.OriginalName
End Sub