EsbGetDatabaseAccess

Description

EsbGetDatabaseAccess() gets a list of user database access structures, which contain information about user access to databases.

Syntax
EsbGetDatabaseAccess (hCtx, User, AppName, DbName, pItems)
ByVal hCtx    As Long
ByVal User    As String
ByVal AppName As String
ByVal DbName  As String
      pItems  As Integer

Parameters

hCtxEssbase VB API context handle.
UserUser name. If an empty string, lists all users for the specified application and database.
AppNameApplication name. If an empty string, lists all applications and databases for the specified user.
DbNameDatabase name. If an empty string, lists all databases for the specified user or application.
pItemsAddress of variable to receive Items of user database structures.

Return Value

If successful, returns a Items of users/databases in pItems, and generates a list of user database structures accessible via EsbGetNextItem().

Notes

Access

This function requires the caller to have Database Design privilege (ESB_PRIV_DBDESIGN) for the specified database, unless they are getting their own database access information.

Example

Declare Function EsbGetDatabaseAccess Lib "ESBAPIW" (ByVal hCtx As Long, ByVal User As String, ByVal AppName As String, ByVal DbName As String, Items As Integer) As Long

Sub ESB_GetDatabaseAccess ()
   Dim Items As Integer
   Dim AppName As String
   Dim DbName As String
   Dim User As String
   Dim UserDb As ESB_USERDB_T
   Dim sts As Long

   AppName = "Sample"
   DbName = "Basic"
   User = "Joseph"

   '********************
   ' Get Database Access
   '******************** 
   sts = EsbGetDatabaseAccess (hCtx,
   User, AppName, DbName, Items)

   For n = 1 To Items

     '******************************
     ' Get next User Database Access
     ' structure from the list
     '****************************** 
     sts = EsbGetNextItem (hCtx, 
     ESB_USERDB_TYPE, UserDb)
   Next
End Sub

See Also

EsbGetApplicationAccess()
EsbGetUser()
EsbListUsers()
EsbSetDatabaseAccess()
EsbGetNextItem()