Wednesday, June 15, 2005

Siebel DataControl Sample Code

Sample Code which uses Siebel data Control to connect to Siebel. Its
available where ever COM objects can be consumed (Java, PHP etc etc).
Change UID and PWD. Check Bookshelf for more documentation on other
properties of DataControl…

[Vbscript]

Dim errCode
Set SiebelApplication = CreateObject("SiebelDataControl.SiebelDataControl.1")
SiebelApplication.Login
"host=""siebel.TCPIP.NONE.NONE://APPSERVER:2321/siebel/eCommunicationsObjMgr_enu""",
"UID","*****"
errCode = SiebelApplication.GetLastErrCode()
If errCode <> 0 Then
ErrText = SiebelApplication.GetLastErrText
Msgbox ErrText
Else
msgbox "Connected"
End If

[Jscript]
var errCode;
SiebelApplication = new ActiveXObject("SiebelDataControl.SiebelDataControl.1");
var ConnStr="host=\"siebel.TCPIP.NONE.NONE://APPSERVER:2321/siebel/eCommunicationsObjMgr_enu\"";
var UID="ROY";
var PWD="*****";
WScript.Echo(ConnStr + UID + PWD);
SiebelApplication.Login(ConnStr, UID,PWD);
errCode = SiebelApplication.GetLastErrCode()
if (errCode != 0)
{
ErrText = SiebelApplication.GetLastErrText();
WScript.Echo(ErrText);
}
else
{
WScript.Echo("Connected");
}