Oracle Objects for OLE
Release 9.0.1

Part Number A90173-01

Home

Book List

Contents

Master Index

Feedback

Example: Count (OraObject) Property

The following example shows the usage of the Count property. Before running the sample code, make sure that you have the necessary datatypes and tables in the database. See Schema Description used in examples of OraObject/OraRef.

Dim OraSession as OraSession

Dim OraDatabase as OraDatabase

Dim OraDynaset as OraDynaset

Dim Address as OraObject

'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&)

'create a dynaset object from person_tab

set OraDynaset = OraDatabase.CreateDynaset("select * from

person_tab",0&)

'retrieve a address column from person_tab.

'Here Value property of OraField object

'returns Address OraObject

set Address = OraDynaset.Fields("Addr").Value

'access the attribute by dot notation

msgbox Address.Street

'access the attribute using '!' notation ( early binding application)

msgbox Address!Street

'access the attribute by index

msgbox Address(1)

'access the attribute by name

msgbox Address("Street")

'access all the attributes of Address OraObject in the dynaset

Do Until OraDynaset.EOF

For index = 1 To Address.Count

msgbox Address(index)

Next Index

OraDynaset.MoveNext

Loop


 
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.

Home

Book List

Contents