# EsbOtlRenameMember

Description

EsbOtlRenameMember() renames a member.

Syntax

    EsbOtlRenameMember (hOutline, hMember, pszNewMember)

    ByVal hOutline     As Long
    ByVal hMember      As Long
    ByVal pszNewMember As String

Parameters

hOutline | Outline context handle.
hMember | Handle of member to rename.
pszNewMember | New member name.

Return Value

Returns 0 if successful; otherwise one of the following:

OTLAPI_BAD_MBRNAME
OTLAPI_BAD_RENAMESHARE
OTLAPI_ERR_RENAMENAMEUSED

Notes

- All shared members are also renamed.
- This call fails if hMember points to a shared member.
- Renaming a zero-level (leaf node) attribute member that is not of type ESB_ATTRMBRDT_STRING resets the following:
  - the attribute value
  - the member's long name, using the specifications for the outline in the ESB_ATTRSPECS_T structure
- Renaming an ancestor may affect the long name of a zero-level attribute member.

Example

    Declare Function EsbOtlRenameMember Lib
    "ESBOTLW" (ByVal hOutline As Long, ByVal hMember As Long,
    ByVal pszNewMember As String) As Long

    Sub ESB_OtlRenameMember()
    Dim sts As Long
    Dim Object As ESB_OBJDEF_T
    Dim hOutline As Long
    Dim hMemProfit As Long

    Object.hCtx = hCtx
    Object.Type = ESB_OBJTYPE_OUTLINE
    Object.AppName = "Sample"
    Object.DbName = "Basic"
    Object.FileName = "Basic"

    sts = EsbOtlOpenOutline(hCtx, Object,
    ESB_YES, ESB_YES, hOutline)

    If sts = 0 Then
       sts = EsbOtlFindMember(hOutline, "Profit",
        hMemProfit)
    End If

    If sts = 0 And hMemberProfit <> 0 Then
       sts = EsbOtlRenameMember(hOutline, hMemProfit,
        "Prelim Profit")
    End If
    End Sub

See Also

EsbOtlFindMember()
EsbOtlMoveMember()
EsbOtlAddMember()
EsbOtlDeleteMember()