EssGConnect

Description

EssGConnect() connects a grid to an Essbase database.

Syntax

ESSG_FUNC_M EssGConnect (hGrid, Server, Username, Password, Application, 
Database, ulOptions);
ESSG_HGRID_T hGrid
ESSG_SERVER_T Server
ESSG_USERNAME_T Username
ESSG_PASSWORD_T Password
ESSG_APPLICATION_T Application
ESSG_DATABASE_T Database
ESSG_ULONG_T ulOptions

Parameters

hGridHandle passed back from EssGNewGrid.
UsernameName of valid user at server.
PasswordPassword of user.
ServerName of a valid server.
ApplicationName of a valid application on server.
DatabaseName of a valid database for application on server.
ulOptionsOptions flag. Values are ESSG_CONNECT_NODIALOG, which attempts to login and connect without displaying dialog, using the default/passed setting; or ESSG_CONNECT_DEFAULT which will display the login and selection dialog.

Return Value

If successful, returns ESSG_STS_NOERR.

Notes

Access

None.

Example

#include <essapin.h>
#include <essgapin.h>

ESSG_FUNC_M         sts = ESS_STS_NOERR;
ESSG_INIT_T         InitStruct;
ESSG_HANDLE_T       Handle;
ESSG_SERVER_T       Server;
ESSG_USERNAME_T     UserName;
ESSG_PASSWORD_T     Password;
ESSG_APPLICATION_T  Application;
ESSG_DATABASE_T     Database;
ESSG_ULONG_T        ulOptions;
ESSG_HGRID_T        hGrid;

InitStruct.ulVersion = ESSG_VERSION;
InitStruct.ulMaxRows = 1000;
InitStruct.ulMaxColumns = 200;
InitStruct.pfnMessageFunc = ESS_NULL;
InitStruct.pUserdata = ESS_NULL;

/* initializes EGAPI */
sts = EssGInit(&InitStruct, &Handle);

/* initializes a specific grid */
if(!sts)
   sts = EssGNewGrid(Handle, &hGrid);

strcpy(Server, "Rainbow");
strcpy(UserName, "Admin");
strcpy(Password, "Password");
strcpy(Application, "Demo");
strcpy(Database, "Basic");
ulOptions = ESSG_CONNECT_NODIALOG;

/* connects the grid to a database on the server */ 
if(!sts)
   sts = EssGConnect(hGrid, Server, UserName, Password, Application,
         Database, ulOptions);
}

See Also

Using the Grid API Functions
Grid API Structures