IsDisconnected: Boolean;
The IsDisconnected method returns that there is no connection with the DB server.
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. To do it, the RefreshO method with corresponding value of the MetabaseRefreshOptions.Reconnect parameter is used.
Executing the example requires a form and a button named Button1 on it.
Add a link to the Metabase system assembly.
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: