説明
コレクション内のOraAttribute
オブジェクトの数を戻します。これは、OraRef
の基礎となる参照可能オブジェクトまたはOraObject
の基礎となる値インスタンスの属性の総数と同じです。実行時は読取り専用です。
例
次の例では、Count
プロパティの使用方法を示します。サンプル・コードを実行する前に、必要なデータ型と表がデータベース内にあることを確認してください。「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