# EsbCreateObject

Description

EsbCreateObject() creates a new object on the server or client object system.

Syntax

    EsbCreateObject (hCtx, ObjType, AppName, DbName, ObjName)

    ByVal hCtx    As Long
    ByVal ObjType As Long
    ByVal AppName As String
    ByVal DbName  As String
    ByVal ObjName As String

Parameters

hCtx | Essbase VB API context handle. Can local context handle returned by EsbCreateLocalContext().
ObjType | Object type (must be single type). Refer to Bitmask Data Types for a list of possible values.
AppName | Application name.
DbName | Database name. If an empty string, uses the application sub-directory.
ObjName | Name of an object to create. Object names can be 8 characters long, and can contain all special characters allowed in DOS file names. No spaces, commas, backslashes, or periods are allowed.

Return Value

None.

Notes

- To create an object, it must not already exist.
- A newly created object on the server contains no data and merely acts as a place holder to prevent another user from creating the object. If you wish to update the created object, you should lock it using EsbLockObject(), then save it using EsbPutObject().

Access

This function requires the caller to have Application or Database Design privilege (ESB_PRIV_APPDESIGN or ESB_PRIV_DBDESIGN) for the specified application or database to contain the object.

Example

    Declare Function EsbCreateObject Lib "ESBAPIW" (ByVal hCtx As Long, ByVal ObjType As Integer, ByVal AppName As String, ByVal DbName As String, ByVal ObjName As String) As Long

    Sub ESB_CreateObject ()
       Dim sts As Long
       Dim AppName As String
       Dim DbName As String
       Dim ObjName As String
       Dim ObjType As Integer

       AppName = "Sample"
       DbName = "Basic"
       ObjName = "Basic"
       ObjType = ESB_OBJTYPE_RULES

       '********************
       ' Create Rules Object
       '********************
       sts = EsbCreateObject (hCtx, ObjType, AppName, DbName, ObjName)
    End Sub

See Also

EsbDeleteObject()
EsbListObjects()
EsbLockObject()
EsbPutObject()
EsbCopyObject()
EsbRenameObject()