EssLoginSetPassword

Description

EssLoginSetPassword() logs in a user, and changes the password. Use this function if the password expires, or must be changed at the next login.

Syntax

ESS_FUNC_M EssLoginSetPassword() (hInstance, Server, UserName, Password, NewPassword, pDbCount, ppDbList, phCtx);

ESS_HINST_THInstance
ESS_STR_TServer
ESS_STR_TUserName
ESS_STR_TPassword
ESS_STR_TNewPassword
ESS_PUSHORT_TpDbCount
ESS_PPAPPDB_TppDbList
ESS_PHCTX_TphCtx

Parameters

hInstanceEssbase API instance handle
ServerNetwork server name
UserNameUser name
PasswordOld password
NewPasswordNew password
pDbCountNumber of accessible databases
ppDbListAddress of the pointer to an array of accessible application-database structures
phCtxPointer to the Essbase context handle

Return Value

If successful, EssLoginSetPassword() returns:

Notes

Access

Before you call EssLoginSetPassword(), call EssInit() to initialize the API, and obtain a valid instance handle.

Example

ESS_FUNC_M
ESS_LoginSetPassword (ESS_HINST_T  hInst)
{
  ESS_FUNC_M   sts = ESS_STS_NOERR;
  ESS_HCTX_T   hCtx;
  ESS_USHORT_T Items;
  ESS_USHORT_T ind;
  ESS_PAPPDB_T pAppsDbs = NULL;   
  ESS_STR_T    SvrName;
  ESS_STR_T    User;
  ESS_STR_T    Password;
  ESS_STR_T    NewPassword;
       
  SvrName     = "POPLAR";
  User        = "Joseph";
  Password    = "Password";
  NewPassword = "NewPassword";

  sts = EssLoginSetPassword (hInst, SvrName, User, Password, NewPassword
                              &Items, &pAppsDbs, &hCtx);
  if (!sts)
  {
    for (ind = 0; ind < Items; ind++)
    {
      if ((pAppsDbs+ind) != NULL)
      {   
        if ((pAppsDbs[ind].AppName != NULL) &&
           (pAppsDbs[ind].DbName  != NULL))
        {
          printf ("%s\r\n", pAppsDbs[ind].AppName);
          printf ("%s\r\n", pAppsDbs[ind].DbName);  
        }
      }
    }
    if (pAppsDbs)
    EssFree(hInst,pAppsDbs);
  }   
  return(sts);
}

See Also

EssAutoLogin()
EssInit()
EssListDatabases
EssLogout()
EssSetActive()