EsbGetAssociatedAttributesInfo

Returns any attribute information associated with a given base member.

Syntax

EsbGetAssociatedAttributesInfo (hCtx, MbrName, AttrDimName, Count)
ByVal hCtx        As Long
ByVal MbrName     As String
ByVal AttrDimName As String
      Count       As Long
ParameterDescription

hCtx

Context handle

MbrName

Base member name

AttrDimName

(Optional) attribute dimension name

Count

Number of attribute members returned

Notes

Return Value

Returns sts = 0 when successful, otherwise returns an error number.

Access

This function requires no special privileges.

Example

Sub ESB_GetAssociatedAttributesInfo()
        ' NOTE: 'Out' is a sub to print the output within quotes to a listbox or text box. 
        Dim hCtx as long
        Dim sts as long   
        Dim MbrName As String
        Dim AttrDimName As String
        Dim Count As Long
        Dim Attribinfo As ESB_ATTRIBUTEINFO_T
        Dim index As Integer
        Dim tempstring As String

        MbrName = InputBox("Base member name", "Base Member Name")
        AttrDimName = InputBox("Attribute Dimension Name (Optional)", "Attribute Dimension Name")

        sts = EsbGetAssociatedAttributesInfo(hCtx, MbrName, AttrDimName, Count)

        If sts <> 0 Then
                MsgBox "Error in ESB_GetAssociatedAttributesInfo: " & sts: Exit Sub
        Else
                tempstring = "...count = " & Count & "..."
                out (tempstring)

                Out "Associated Attr info for " & "[" & MbrName & "]"
                Out "------------------------------------"

                For index = 1 To Count
                        sts = EsbGetNextItem(hCtx, ESB_ATTRIBUTEINFO_TYPE, Attribinfo)
                        Out "Dim Name: " & Attribinfo.DimName
                        Out "Mbr Name: " & Attribinfo.MbrName

                ' NOTE: use of select case statement to discern (and act upon) type of attribute returned
                Select Case VarType(Attribinfo.Attribute)
                        Case vbDouble
                                Out "Data Type    : Numeric(Double)"
                                Out "Data Value   : " & Attribinfo.Attribute
                                Out ""
                        Case vbBoolean
                                Out "Data Type    : Boolean"
                                Out "Data Value   : " & Attribinfo.Attribute
                                Out ""
                        Case vbDate
                                Out "Data Type    : Date"
                                 ' Suggested way to get Date Attribute value for display
                                Out "Data Value   : " & Attribinfo.DimName
                                Out ""
                        Case vbString
                                Out "Data Type    : String"
                                Out "Data Value   : " & Attribinfo.Attribute
                                Out ""
                                End Select
                                Out ""
                        Next index
        End If
End Sub

See Also