Login Method for an Application
The Login method allows an external application to do the following:
Log in to the COM Data Server, COM Data Control, or Siebel Java Data Bean.
Access Siebel objects.
The Login method allows the end user to call the Siebel application without being prompted for a login and password. The Login method determines the privileges granted, and the role and responsibility of the end user for that session.
This method returns a string that contains the error code.
Format
Application.Login([connectString,] username, password)
The following table describes the arguments for the Login method.
Argument | Description |
---|---|
connectString |
Connect string that uses a token. |
username |
Username for the login. |
password |
User password for the login. |
Usage
Verify that the Siebel\bin
folder is the current folder. To access Data Control, you must do
the following work:
Make sure the default Data Source references the Siebel database that you must access. For more information, see Setting the Connect String.
In the Siebel application configuration (CFG) file, make sure the EnableOLEAutomation parameter is TRUE.
Used With
COM Data Control, COM Data Server, Mobile Web Client Automation Server, Siebel Java Data Bean
Examples
The connect string for COM Data Control uses a token. For example:
host = "Siebel://my_computer/SIEBEL/objsrvr/my_computer" lang = "ENU"
Most languages use quotes to enclose a text string, so you must use quotes in parentheses. For example:
To use COM Data Control in Visual Basic:
m_dataBean.login("siebel.tcpip.none.none://gateway:gatewayport/ enterpriseserver/SCCObjMgr", "username", "password");
To use COM Data Control in C++:
Login("host=\"siebel://my_computer/SIEBEL/objsvr/my_computer\" lang = \"ENU\"","user","password");
The following example logs in to the Siebel Server and determines if errors exist:
Call SiebelAppControl.Login("host=""siebel://gtwy/enterprise/ObjMgr""",
"SADMIN", "SADMIN")
//Check for errors
If SiebelAppControl.GetLastErrCode <> 0 Then
frmMain.txtStatus.Text = SiebelAppControl.GetLasErrText
Else
frmMain.txtStatus.Text = "Connected successfully..."
End If
The following is a Siebel Java Data Bean example that logs in to a Siebel Server and then logs off:
import com.siebel.data.*;
import com.siebel.data.SiebelException;
public class JDBLoginLogoffDemo
{
private SiebelDataBean m_dataBean = null;
public static void main(String[] args)
{
JDBLoginLogoffDemo demo = new JDBLoginLogoffDemo();
}
public JDBLoginLogoffDemo()
{
try
{
// instantiate the Siebel Java Data Bean
m_dataBean = new SiebelDataBean();
// login to the Siebel Servers
m_dataBean.login("siebel.tcpip.none.none://gateway:port/enterprise/
object manager","userid","password");
System.out.println("Logged in to the Siebel Server ");
//perform function code
//release the business object
// logoff
m_dataBean.logoff();
System.out.println("Logged off the Siebel Server ");
}
catch (SiebelException e)
{
System.out.println(e.getErrorMessage());
}
}
}