IMetabase.IsDisconnected

Syntax

IsDisconnected: Boolean;

Description

The IsDisconnected method returns that there is no connection with the DB server.

Comments

The method returns True if connection with the DB server is not available, and returns False if connection is available. In case of connection unavailability the user may try to restore it. The RefreshO method with the relevant value of the MetabaseRefreshOptions.Reconnect parameter is used for that.

Example

Executing the example requires a form and a button named Button1 on it.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

MB: IMetabase;

Begin

MB := MetabaseClass.Active;

Try

MB.Refresh;

Except

If MB.IsDisconnected Then

MB.RefreshO(

MetabaseRefreshOptions.Reconnect Or

MetabaseRefreshOptions.NoObjects Or

MetabaseRefreshOptions.NoRefreshEvent);

End If;

End Try;

End Sub Button1OnClick;

After executing the example pressing the button updates the tree of repository objects. If an error, connected with the loss of connection with the DB server, occurs during updating, the connection is restored.

See also:

IMetabase | IMetabase.RefreshO