IMetabaseDefinitions.Count

Syntax

Count: Integer;

Description

The Count property returns the number of descriptions of the repositories that were registered on the workstation.

Example

Sub UserProc;
Var
    Man: IMetabaseManager;
    Defs: IMetabaseDefinitions;
    Def: IMetabaseDefinition;
    i, c: Integer;
Begin
    Man := MetabaseManagerFactory.Active;
    Defs := Man.Definitions;
    c := Defs.Count;
    For i := 0 To c - 1 do
        Def := Defs.Item(i);
        Debug.Write("Repository: " + Def.Name + '(' + Def.Id + "). Server: ");
        Select Case Def.DriverId
            Case "OLEDB(DB2)": Debug.WriteLine((Def.LogonData As IPrimaryDB2SPLD).Server);
            Case "MSSQL2008""MSSQL2012""MSSQL2012ODBC": Debug.WriteLine((Def.LogonData As IPrimaryMsSqlSPLD).Server);
            Case "ORCL8": Debug.WriteLine((Def.LogonData As IPrimaryOracleSPLD).Server);
            Case "POSTGRES": Debug.WriteLine((Def.LogonData As IPrimaryPostgresSPLD).Server);
            Case "WSF": Debug.WriteLine((Def.LogonData As IPrimaryServiceSPLD).Endpoint);
            Case "SQLITE": Debug.WriteLine((Def.LogonData As IPrimarySQLiteSPLD).FileName);
            Case "TRDT": Debug.WriteLine((Def.LogonData As IPrimaryTeradataSPLD).Server);
        End Select;
    End For;
End Sub UserProc;

After executing the example the development environment console displays the list of descriptions of the repositories registered in the repository manager.

See also:

IMetabaseDefinitions