# EsbListDatabases

Description

EsbListDatabases() lists all databases which are accessible to the caller, either within a specific application, or on an entire server.

Syntax

    EsbListDatabases (hCtx, AppName, pItems)

    ByVal hCtx    As Long
    ByVal AppName As String
          pItems  As Integer

Parameters

hCtx | Essbase VB API context handle.
AppName | Application name.
pItems | Address of variable to receive count of applications and databases.

Return Value

If successful, this function returns a count of the number of accessible databases in pCount, and generates a list of the application and database names that is accessible via EsbGetNextItem().

Notes

- If the AppName argument is an empty string, this function lists all the accessible applications and databases on the server.

Access

This function requires no special privileges; note however that server databases will only be listed if the caller has access to them.

Example

    Declare Function EsbListDatabases Lib "ESBAPIW" (ByVal hCtx As Long, ByVal AppName As String, Count As Integer) As Long

    Sub ESB_ListDatabases ()
       Dim pItems As Integer
       Dim AppName As String
       Dim AppDb As ESB_APPDB_T
       Dim sts As Long

       AppName = "Sample"

       '***************
       ' List Databases
       '***************
       sts = EsbListDatabases (hCtx, AppName, pItems)

       For n = 1 To pItems

         '******************************
         ' Get next Application/Database
         ' item from the list
         '******************************
         sts = EsbGetNextItem (hCtx,
               ESB_APPDB_TYPE, AppDb)
       Next
    End Sub

See Also

EsbGetDatabaseInfo()
EsbGetDatabaseState()
EsbListApplications()
EsbListCurrencyDatabases()
EsbListObjects()
EsbGetNextItem()