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
ParameterDescription

hCtx

VB API context handle.

User

User name. If an empty string, lists all users for the specified application and database.

AppName

Application name. If an empty string, lists all applications and databases for the specified user.

DbName

Database name. If an empty string, lists all databases for the specified user or application.

pItems

Address of variable to receive Items of user database structures.

Notes

Return Value

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

Access

This function requires callers 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 "ESBAPIN" (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