EssGConnect() connects a grid to an Essbase database.
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 |
hGrid | Handle passed back from EssGNewGrid. |
Username | Name of valid user at server. |
Password | Password of user. |
Server | Name of a valid server. |
Application | Name of a valid application on server. |
Database | Name of a valid database for application on server. |
ulOptions | Options 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. |
If successful, returns ESSG_STS_NOERR.
None.
#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); }