API:Datasnap.DBClient.TConnectionBroker.OnLogin
Delphi
property OnLogin;
C++
__property OnLogin;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
event | published | Datasnap.DBClient.pas Datasnap.DBClient.hpp |
Datasnap.DBClient | TConnectionBroker |
Description
Occurs when a communication channel opens to the server.
Datasnap.DBClient.TConnectionBroker.OnLogin inherits from Data.DB.TCustomConnection.OnLogin. All content below this line refers to Data.DB.TCustomConnection.OnLogin.
Occurs when a communication channel opens to the server.
OnLogin occurs when connections are opened if the LoginPrompt property is true.
For DataSnap connection components, the following sequence of events occurs when opening a connection to an application server:
- An OnGetUsername event occurs, where the application can supply an initial user name for the login dialog.
- The login dialog appears, where the user can supply a user name and password.
- A BeforeConnect event occurs, the connection is opened, and an AfterConnect event occurs.
- 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:
- A BeforeConnect event occurs.
- 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.
- The login dialog appears, where the user can supply a user name and password.
- 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).
- The connection is opened, and an AfterConnect event occurs.
Note: Some 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.