RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDispatchConnection.OnLogin Property

Occurs when a communication channel opens to the server.

Pascal
property OnLogin: TLoginEvent;
C++
__property TLoginEvent OnLogin;

OnLogin occurs when connections are opened if the LoginPrompt property is true.  

For DataSnap SOAP connection components, the following sequence of events occurs when opening a connection to an application server: 

 

  1. An OnGetUsername event occurs, where the application can supply an initial user name for the login dialog. 

  2. The login dialog appears, where the user can supply a user name and password. 

  3. A BeforeConnect event occurs, the connection is opened, and an AfterConnect event occurs. 

  4. The OnLogin event occurs, where you can write code to log in to the application server using the username and password that were provided in the remote login dialog.
    Note: Do not use the OnLogin event if the connection component provides a different scheme for logging in. For example, TWebConnection uses the Username and Password properties instead.
    For ADO connection components, the following sequence of events occurs when opening a connection to an application server:  

1. A BeforeConnect event occurs.  

2. An OnWillConnect event occurs, where the application can supply an initial user name and password for the login dialog, as well as the connection options and status.  

3. The login dialog appears, where the user can supply a user name and password.  

4. The OnLogin event occurs, where you can write code to respond to the user-supplied values. (For example, you could convert an application-specific user name and password to database user name and password).  

5. The connection is opened, and an AfterConnect event occurs.

Note: Some
C connection components that do not connect to an application server in a multitiered database application replace the OnLogin event defined in TCustomConnection with a different event that occurs before a connection is established.  

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!