Open Test Architecture API Type Library
Login Method
The user name defined in the project data base.
The user's password.
Description
Authorizes the user. On success, , the user is logged in and can connect to projects.
Syntax
Visual Basic
Public Sub Login( _
   ByVal UserName As String, _
   ByVal Password As String _
) 
Parameters
UserName
The user name defined in the project data base.
Password
The user's password.

For 15.0.1 and later, you can also login with your API key and API key secret. In SSO mode, only login with API key and API key secrtet is supported. In non-SSO mode, login with either username/password or API key/PI Key secret is supported.

Note: Login with username and password can be restricted for external applications by using the OTA_ACCESS_APIKEY_ONLY parameter. For details, see the main help.

Remarks

Before authenticating a user with Login, connect to the server with InitConnectionEx.

After a successful call to Login, the user is authenticated on the server, but not connected to any project. Therefore, the LoggedIn Property and the Connected Property are True and the ProjectConnected Property is False.

For a table of properties affected by the state of the connection, see the Remarks for the TDConnection object.

Example
VBA/VBScript
Sub initConn()
    Set tdCnn = New TDConnection
    tdCnn.ClientType("hehe") = ""
    tdCnn.InitConnection ("http://localhost:1260/qcbin")
    tdCnn.Login "sa", ""
End Sub
C#
Sub initConn()
    TDConnection tdConn = new TDConnection();
    tdConn.ClientType[ClientType] = ""
    tdConn.InitConnection(serverUrl)
       tdConn.Login("sa", "");
See Also

TDConnection Object  | TDConnection Members  | Connect Method