ISecurityConnection2.SupportsConnectionType

Fore Syntax

SupportsConnectionType(Type:DalConnectionType): Boolean;

Fore.NET Syntax

SupportsConnectionType(Prognoz.Platform.Interop.Dal.DalConnectionType): System.Boolean;

Parameters

Type. Parameter determines connection type with database.

Description

The SupportsConnectionType method determines whether the connection type mentioned in parameters is supported by the driver.

Comments

This method returns True if the specified connection type is supported by the driver; otherwise the method returns False.

Fore Example

To execute the example, connect the Metabase, Dal and Db system assemblies to the module.

Sub UserProc;
Var
    MB: IMetabase;
    DB: IDatabaseInstance;
    Connect: ISecurityConnection;
    CloneConnect: ISecurityConnection;
    Connect2: ISecurityConnection2;
Begin
    MB := MetabaseClass.Active;
    DB := MB.ItemById("BD").Open(NullAs IDatabaseInstance;
    Connect := DB.Connection;
    Connect2 := Connect As ISecurityConnection2;
    debug.WriteLine(Connect2.Type);
    if Connect2.SupportsConnectionType(DalConnectionType.FastInsert) then
        CloneConnect := Connect2.Clone(DalConnectionType.FastInsert);
    end if;
End Sub UserProc;

After executing this example a connection type is displayed in the console window, and a copy of available connection (Connection for fast insert) if the driver supports this connection type, is created.

Fore.NET Example

To execute the example connect the Dal and Db system assemblies to the NET.module.

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.Db;

...

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    DB: IDatabaseInstance;
    Connect: ISecurityConnection;
    CloneConnect: ISecurityConnection;
    Connect2: ISecurityConnection2;
Begin
    MB := Params.Metabase;
    DB := MB.ItemById["BD"].Open(NullAs IDatabaseInstance;
    Connect := DB.Connection;
    Connect2 := Connect As ISecurityConnection2;
    System.Diagnostics.Debug.WriteLine(Connect2.Type);
   if Connect2.SupportsConnectionType(DalConnectionType.dctFastInsert) then
        CloneConnect := Connect2.Clone(DalConnectionType.dctFastInsert);
    end if;
End Sub;

After executing this example a connection type is displayed in the console window, and a copy of available connection (Connection for fast insert) if the driver supports this connection type, is created.

See also:

ISecurityConnection2