# EsbOtlFreeMember

Description

EsbOtlFreeMember() this function is called to free any member returned from EsbOtlQueryMembers when EsbGetNextItem is called.

Syntax

    EsbOtlFreeMember (hOutline, hMember)

    ByVal hOutline As Long
    ByVal hMember  As Long

Parameters

hOutline | Essbase outline handle, returned from EsbOtlOpenOutlineQuery().
hMember | The member handle defining the member to free.

Return Value

Returns zero if successful.

Notes

- The results from EsbOtlQueryMembers() returns one member at a time via the EsbGetNextItem() call. When each of these items is done being used, the programmer should call EsbOtlFreeMember().

Example

    Declare Function EsbOtlFreeMember Lib "ESBOTLW"
    (ByVal hOutline As Long, ByVal hMember As Long) As Long
    Declare Function EsbOtlQueryMembers Lib "ESBOTLW"
    (ByVal hOutline As Long, ByVal hMember As Long,
    pPredicate As ESB_PREDICATE_T, pCounts As ESB_MBRCOUNTS_T) As Long

    Sub ESB_OtlQueryMembers()
       Dim sts As Long
       Dim hOutline As Long
       Dim hMember As Long
       Dim ihMember As Long
       Dim Object As ESB_OBJDEF_T
       Dim MbrInfo As ESB_MBRINFO_T
       Dim Predicate As ESB_PREDICATE_T
       Dim Counts As ESB_MBRCOUNTS_T
       Dim Access As Integer
       Dim AppName As String
       Dim DbName As String

       AppName = "Sample"
       DbName = "Basic"

       sts = EsbOtlOpenOutlineQuery(hCtx, Object, hOutline)
       If sts = 0 Then
         sts = EsbOtlOpenOutlineQuery(hCtx, Object, hOutline)

       Predicate.ulQuery = ESB_CHILDREN
       Predicate.pszDimension = "Year"
       Counts.ulStart = 0
       Counts.ulMaxCount = 10

       If sts = 0 Then
          sts = EsbOtlQueryMembers(hOutline, hMember, Predicate, Counts)

         If sts = 0 And Counts.ulReturnCount <> 0 Then
           For n% = 1 To Counts.ulReturnCount
              sts = EsbGetNextItem(hCtx, ESB_HMEMBER_TYPE, ihMember)
           If sts = 0 And ihMember <> 0 Then
                    sts = EsbOtlFreeMember(hOutline, ihMember)
           End If
          Next
         End If
       End If
    End If
    End Sub

See Also

EsbOtlOpenOutlineQuery()
EsbOtlQueryMembers()
EsbOtlQueryMembersByName()