# EsbSetDatabaseAccess

Description

EsbSetDatabaseAccess() sets a user database access structure, which contains information about user access to a database.

Syntax

    EsbSetDatabaseAccess (hCtx, Items, pUserDb)

    ByVal hCtx     As Long
    ByVal Items    As Integer
    ByVal pUserDb  As ESB_USERDB_T

Parameters

hCtx | Essbase VB API context handle.
Items | Reserved for future use.
pUserDb | Pointer to a user database structure.

Return Value

None.

Notes

- The Access field of the user database structure is used to set the user's granted access to the database. For this call the MaxAccess and FilterName fields are ignored.

Access

This function requires the caller to have Database Design privilege (ESB_PRIV_DBDESIGN) for the specified database.

Example

    Declare Function EsbSetDatabaseAccess Lib "ESBAPIW" (ByVal hCtx As Long, ByVal Items As Integer, UserDb As ESB_USERDB_T) As Long

    Sub EsbSetDatabaseAccess ()
       Dim sts As Long
       Dim hCtx As Long
       Dim Items As Integer
       Dim UserDb As ESB_USERDB_T

       '*****************************
       ' Initialize UserDb structure
       '*****************************
       UserDb.UserName = "Joseph"
       UserDb.AppName = "Sample"
       UserDb.DbName = "Basic"
       UserDb.Access = ESB_ACCESS_SUPER
       UserDb.MaxAccess = ESB_ACCESS_SUPER
       UserDb.FilterName = ""

       '***************************
       ' Set Supervisor access level
       '***************************
       sts = EsbSetDatabaseAccess (hCtx, Items, UserDb)
    End Sub

See Also

EsbGetDatabaseAccess()
EsbListUsers()
EsbSetApplicationAccess()
EsbSetUser()