Siebel VB Language Reference > Methods Reference for Siebel VB > COM Methods >

COM Object Class


The COM Object class provides access to a COM object. It does not return a value. To create a new object, you use the Dim statement to dimension a variable, and then set the variable to the return value of CreateObject or GetObject. For example:

Dim COM As Object
Set COM = CreateObject
("spoly.cpoly")

You can use one of the following formats to reference a method or property of the new object:

objectvar.property
objectvar.method

For example:

COM.reset

Format

Dim variableName As Object

The following table describes the arguments that you can use with this method.

Argument
Description

variableName

The name of the object variable to declare.

Example

The following example uses the BusComp object class to declare the variables that Siebel VB uses to access the Account Contacts view in a Siebel application:

Sub Button1_Click
   Dim i as integer
   Dim icount as integer
   Dim oBC as BusComp

   ' BusObject returns the business object associated with a
   ' control or applet.
   ' GetBusComp returns a reference to a Siebel
   ' business component that is in the UI context

   set oBC = me.BusObject.GetBusComp("Contact")

   i = oBC.FirstRecord ' returns 0 if fails, 1 if succeeds
   if i <> 1 then
      TheRaiseErrorText "Error accessing contact records for the account."
   else
      icount = 0
      ' NextRecord returns 1 if it successfully
      ' moved to the next record in the BC
      While i = 1
         icount = icount + 1
         i = oBC.NextRecord ' returns 1 if successful
      wend
      oBC.FirstRecord
      end if
End Sub

Siebel VB Language Reference Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Legal Notices.