説明
OraAttributeオブジェクトは、OraObjectまたはOraRefのValueまたはREFインスタンスの属性を表します。
備考
OraAttributeオブジェクトは、順序を示す整数を使用する添字を作成するか、または名前属性を使用することによって、OraObjectまたはOraRefオブジェクトからアクセスできます。
OraAttributeオブジェクトのValueプロパティの属性の型および戻り値を識別する表は、Value(OraAttribute)プロパティを参照してください。
プロパティ
メソッド
なし
例
次の例では、サーバー内のADDRESS値インスタンスの属性にアクセスします。サンプル・コードを実行する前に、必要なデータ型と表がデータベース内にあることを確認してください。「OraObjectおよびOraRefの例で使用されているスキーマ・オブジェクト」を参照してください。
Dim OraSession As OraSession
Dim OraDatabase As OraDatabase
Dim OraDynaset As OraDynaset
Dim Address As OraObject
Dim City As OraAttribute
Dim State As OraAttribute
'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 an address column from person_tab
'the Value property of OraField object returns Address OraObject
Set Address = OraDynaset.Fields("Addr").Value
'access the City attribute object
Set City = Address("City")
' display the value of City attribute Object
MsgBox City.Value
'access the State attribute object
Set State = Address("State")
'display the value of State attribute Object
MsgBox State.Value