IsDisconnected: Boolean;
The IsDisconnected property returns whether there is no connection with database.
Available values:
True. No connection.
False. The connection is established and available for further work.
Sub UserProc;
Var
Driver: IDalDriver;
Connect: IDalConnection;
ConnectDesc: IDalConnectionDescriptor;
ConnectDescParams: IDalConnectionDescriptorParams;
b: Boolean;
Begin
Driver := New DalOrcl8Driver.Create;
ConnectDesc := Driver.CreateDescriptor;
//Connection parameters
ConnectDescParams := ConnectDesc.Params;
ConnectDescParams.Find("User Name").Value := "User";
ConnectDescParams.Find("Password").Value := "Password";
ConnectDescParams.Find("Host BSTR").Value := "OrclServer";
ConnectDescParams.Find("Schema").Value := "Repository";
Connect := ConnectDesc.CreateConnection;
b := Connect.IsDisconnected;
End Sub UserProc;
On executing the example the repository connection is established with specified location parameters. The "b" variable will store the value corresponding to database connection status.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.PiLibNet.Utils;
Sub UserProc();
Var
Driver: DalOrcl8Driver = ComCreator.Instance.CoCreate<DalOrcl8DriverClass>();
Connect: IDalConnection;
ConnectDesc: IDalConnectionDescriptor;
ConnectDescParams: IDalConnectionDescriptorParams;
b: Boolean;
Begin
ConnectDesc := Driver.CreateDescriptor();
//Connection parameters
ConnectDescParams := ConnectDesc.Params;
ConnectDescParams.Find("User Name").Value := "User";
ConnectDescParams.Find("Password").Value := "Password";
ConnectDescParams.Find("Host BSTR").Value := "OrclServer";
ConnectDescParams.Find("Schema").Value := "Repository";
Connect := ConnectDesc.CreateConnection();
b := Connect.IsDisconnected;
End Sub;
See also: