Logon - cMapiHandler
Makes a connection between DataFlex and MAPI using either the passed username and password or the values from the properties psUserName and psPassword
Type: Function
Return Data Type: Integer
Parameters
| Parameter | Type | Description |
|---|---|---|
| sProfileName | String | This parameter - also known as profile name - is needed when the MAPI connection needs a username and password. Not always required. |
| sPassWord | String | The password of the username, not encrypted. |
| iFlags | Integer | One of the following values:ConstantMeaning |
Syntax
Function Logon String sProfileName String sPassWord Integer iFlags Returns Integer
Call Example
Get Logon sProfileName sPassWord iFlags to IntegerVariable
Description
Logon makes a connection between DataFlex and MAPI using either the passed username and password or the values from the properties psUserName and psPassword. When the parameters are passed as empty strings the values from the properties are taken. The result of the action will be reflected in a session id that will be stored in the property phSessionID.
This function returns one of the following error codes if not successful:
| Error code | Meaning |
|---|---|
| 1 | The user canceled the logon dialog box. No session handle was returned. |
| 2 | The flFlags parameter is invalid or one or more unspecified errors occurred. |
| 3 | There was no default logon, and the user failed to log on successfully when the logon dialog box was displayed. No session handle was returned. |
| 5 | There was insufficient memory to proceed. The session was not terminated. |
| 8 | The user had too many sessions open simultaneously. No session handle was returned. |
Example
Get Logon Of oMapiSession sUserName sPassword iFlags To iRetval
Return Value
Returns an error codes if not successful