Bookshelf Home | Contents | Index | Search | PDF |
Siebel Object Interfaces Reference > Programming > Getting Started with the Siebel Object Interfaces >
Instantiating the Siebel COM Data Control
To use Siebel Interface methods with the Siebel COM Data Control, use the object browser of your Siebel COM Data Control programming tool to determine the correct method syntax.
To set up Microsoft Visual Basic to access the Siebel COM Data Control Interface
- Be sure you have installed the Siebel COM Data Control. Read Installing Siebel Object Interfaces.
- Start Microsoft Visual Basic.
- Select Standard EXE.
- Choose Project > References.
- In the list box, highlight (but do not check) Siebel BusObject Interfaces Type Library. Near the bottom of the dialog box, note the directory in which the file
sstchca.dll
resides, as shown in the following illustration.- Open the Object Browser to verify that you can see the Siebel objects.
To instantiate and use the Siebel COM Data Control, you must use the CreateObject and Login methods. You cannot use methods that retrieve active Siebel objects, because there are no current active Siebel objects. You must instantiate your own Siebel objects. Calls made to the Siebel COM Data Control are also in-process.
The following is sample code for the Siebel COM Data Control.
Sub CreateDataControl()
Dim errCode As Integer
Set SiebelApplication = CreateObject("SiebelDataControl.SiebelDataControl.1")
SiebelApplication.Login "host=""siebel//:host/EnterpriseServer/ AppObjMgr/SiebelServer""", "CCONWAY","CCONWAY"
errCode = SiebelApplication.GetLastErrCode()
If errCode <> 0 Then
ErrText = SiebelApplication.GetLastErrText
TheApplication().RaiseErrorText(ErrText);
Exit Sub
End If
set OpptyB0 = SiebelApplication.GetBusObject("Opportunity",errCode)
set OpptyBC = OpptyBO.GetBusComp("Opportunity", errCode)
End SubSee Table 23 for values to substitute for the placeholders in the login string.
Here is sample code for instantiating the COM Data Control from a server-side ASP script.
NOTE: The symbols
<%
and%>
are used within HTML script to set off an ASP script.<%
Dim SiebelApplication, BO, BC, ConnStr, logstat
Dim strLastName, strFirstName, errCode, errTextSet SiebelApplication = CreateObject("SiebelDataControl.SiebelDataControl.1")
' Test to see if object is created
If IsObject(SiebelApplication) = False then
Response.Write "Unable to initiate Siebel Session.
Else
connStr = "host=" & Chr(34) & "siebel.tcpip.none.none://gateway:2320/EntServer/ObjMgr/siebSrvr" & Chr(34) & " lang=" & Chr(34) & "<lang>" & Chr(34)
logstat = SiebelApplication.Login ConnStr, "SADMIN", "SADMIN"response.write("Login Status: " & logstat)
Set BO = SiebelApplication.GetBusObject("Employee")
Set BC = BO.GetBusComp("Employee")
End If%>
For more information on instantiating the Siebel COM Data Control, read Connect String.
Bookshelf Home | Contents | Index | Search | PDF |
Siebel Object Interfaces Reference Published: 18 June 2003 |