EsbGetObject

Copies an object from the server or client object system to a local file, and optionally locks it.

Syntax

EsbGetObject (hCtx, ObjType, AppName, DbName, ObjName, LocalName, isLock)
ByVal hCtx      As Long
ByVal ObjType   As Long
ByVal AppName   As String
ByVal DbName    As String
ByVal objName   As String
ByVal LocalName As String
ByVal isLock    As Integer
ParameterDescription

hCtx

VB API context handle. Can be local context handle returned by EsbCreateLocalContext().

ObjType

Object type (must be single type). Refer to "Bitmask Types."

AppName

Application name.

DbName

Database name. If an empty string, uses the Application sub-directory.

ObjName

Name of an object to get.

LocalName

Full path name of a local destination file on client.

isLock

Flag to control object locking. If TRUE, the server object is locked to prevent updates by other users.

Notes

To lock an object, it must already exist on the server and not be locked by another user. Locking is not supported on the client.

Return Value

If successful, the object is copied to the local file specified by LocalName.

Access

This function requires the caller to have the appropriate level of access to the specified application and/or database containing the object (depending on the object type). To lock the object (lock flag is TRUE), the caller must have Application or Database Manager privilege (ESB_PRIV_APPDESIGN or ESB_PRIV_DBDESIGN) for the specified application or database containing the object.

Example

Declare Function EsbGetObject Lib "ESBAPIN" (ByVal hCtx As Long, ByVal ObjType As Integer, ByVal AppName As String, ByVal DbName As String, ByVal ObjName As String, ByVal LocalName As String, ByVal Lock As Integer)
 As Long
 
 Sub ESB_GetObject ()
   Dim sts As Long
   Dim AppName As String
   Dim DbName As String
   Dim ObjName As String
   Dim ObjType As Long
   Dim LocalName As String
   Dim Lock As Integer   AppName = "Sample"
   DbName = "Basic"
   ObjName = "Basic"
   ObjType = ESB_OBJTYPE_OUTLINE
   LocalName = "C:\ESSBASE\CLIENT\BASIC.OTL" 
   Lock = ESB_YES   '***********
   ' Get Object 
   '***********
   sts = EsbGetObject (hCtx, ObjType, AppName,
         DbName, ObjName, LocalName, Lock) 
End Sub

See Also