# EsbCopyApplication

Description

EsbCopyApplication() copies an existing application, either on the client or the server, to a new application, including all associated databases and objects. If the application is copied on the server, the new application is started.

Syntax

    EsbCopyApplication (hCtx, hSrcCtx, AppName, nAppName)

    ByVal hCtx     As Long
    ByVal hSrcCtx  As Long
    ByVal AppName  As String
    ByVal nAppName As String

Parameters

hCtx | Essbase VB API context handle.
hSrcCtx | Not used - should be same as hCtx.
AppName | Name of an existing application to copy.
nAppName | Name of a new application.

Return Value

None.

Notes

- Copying a client application copies the local application directory and contents.
- This function can only be used to copy a client application to a new application on the client, or a server application to a new application on the same server. Use EsbCopyObject() to copy an application between different servers.

Access

For a server application, the caller must have application Create/Delete/Edit privilege (ESB_PRIV_APPCREATE).

Example

    Declare Function EsbCopyApplication Lib "ESBAPIW" (ByVal hCtx As Long, ByVal hSrcCtx As Long, ByVal SrcApp As String, ByVal DestApp As String) As Long

    Sub ESB_CopyApplication ()
       Dim sts As Long
       Dim SrcApp As String
       Dim DestApp As String
       Dim hSrcCtx As Long

       hSrcCtx = hCtx
       SrcApp = "Sample"
       DestApp = "NewTest"

       '*****************
       ' Copy Application
       '*****************
       sts = EsbCopyApplication (hCtx, hSrcCtx,
       SrcApp, DestApp)
    End Sub

See Also

EsbCopyDatabase()
EsbCopyObject()