Gets the names of the caller's current active application and database.
Syntax
EsbGetActive (hCtx, AppName, szApp, DbName, szDb, pAccess) ByVal hCtx As Long ByVal AppName As String ByVal szApp As Integer ByVal DbName As String ByVal szDb As Integer ByVal pAccess As Integer
Parameter | Description |
---|---|
hCtx | VB API context handle. |
AppName | Buffer to receive an application name string. |
szApp | Size of an application name string buffer. |
DbName | Buffer to receive a database name string. |
szDb | Size of the database name string buffer. |
pAccess | Address of variable to receive the user's access level to the selected database. |
Notes
If application/database name length is greater than the size of the buffer, the name is truncated.
Return Value
If successful, returns the user's selected active application and database in AppName and DbName.
Access
This function requires no special privileges.
Example
Declare Function EsbGetActive Lib "ESBAPIN" (ByVal hCtx As Long, ByVal AppName As String, ByVal szApp As Integer, ByVal DbName As String, ByVal szDb As Integer, Access As Integer) As Long Sub ESB_GetActive () Dim AppName As String * ESB_APPNAMELEN Dim DbName As String * ESB_DBNAMELEN Dim sts As Long Dim szApp As Integer Dim szDb As Integer Dim pAccess As Integer szApp = ESB_APPNAMELEN szDb = ESB_DBNAMELEN '********************************** ' Get active Application & Database '********************************** sts = EsbGetActive (hCtx, AppName, szApp, DbName, szDb, Access) End Sub
See Also