# EsbDeleteLocationAlias

Description

EsbDeleteLocationAlias() deletes an existing location alias.

Syntax

    EsbDeleteLocationAlias (hCtx, AliasName)

    ByVal hCtx      As Long
    ByVal AliasName As String

Parameters

hCtx | Essbase API context handle
AliasName | Location alias

Return Value

Returns an error if a location alias with the name AliasName is not found.

Notes

Access

Example

    Public Sub LocationAliasTest()

      Dim status    As Long
      Dim ListCount As Integer
      Dim Aliases   As Variant
      Dim HostNames As Variant
      Dim AppNames  As Variant
      Dim DbNames   As Variant
      Dim UserNames As Variant

      status = EsbCreateLocationAlias(hCtx, "blah1", "LocalHost", "Demo", "Basic", _
                                    "admin", "password")
      If (status <> 0) Then
        MsgBox "Create routine Failed"
        Exit Sub
      End If

      status = EsbCreateLocationAlias(hCtx, "blah2", "LocalHost", "Demo", "Basic", _
                                      "admin", "password")
      If (status <> 0) Then
        MsgBox "Create routine Failed"
        Exit Sub
      End If

      status = EsbGetLocationAliasList(hCtx, ListCount, Aliases, HostNames, _
                                       AppNames, DbNames, UserNames)
      If (status <> 0) Then
        MsgBox "Get routine Failed"
        Exit Sub
      End If

      If (ListCount > 0) Then
            ' Retrieve the elements as Aliases(0) to Aliases(ListCount -1)
      End If

      status = EsbDeleteLocationAlias(hCtx, "blah1")
      If (status <> 0) Then
        MsgBox "Delete routine Failed"
        Exit Sub
      End If

      status = EsbGetLocationAliasList(hCtx, ListCount, Aliases, HostNames, _
                                       AppNames, DbNames, UserNames)
      If (status <> 0) Then
        MsgBox "Get routine Failed"
        Exit Sub
      End If

    End Sub

See Also

EsbCreateLocationAlias()
EsbGetLocationAliasList()