Datasnap.Win.MConnect.TCOMConnection.SetConnected

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure SetConnected(Value: Boolean); override;

C++

virtual void __fastcall SetConnected(bool Value);

Properties

Type Visibility Source Unit Parent
procedure
function
protected
Datasnap.Win.MConnect.pas
Datasnap.Win.MConnect.hpp
Datasnap.Win.MConnect TCOMConnection

Description

Sets the Connected property.

SetConnected is the protected implementation of the Connected property.

If Value is false, SetConnected generates a BeforeDisconnect event, closes the connection, and generates an AfterDisconnect event.

If Value is true, SetConnected performs the following actions:

1. It checks the value of the ServerGUID or ServerName property and raises an exception if these do not specify a valid application server.

2. If LoginPrompt is true, and the connection is not already open, SetConnected generates an OnGetUsername event, and uses that to initialize a login dialog. It displays the login dialog, and aborts the connection if the user cancels.

3. It generates a BeforeConnect event.

4. It opens the connection.

5. It generates an AfterConnect event.

6. If LoginPrompt is true, and the connection opened successfully, SetConnected generates an OnLogin event.

See Also