Connects a grid to an Essbase database.
Syntax
ESSG_FUNC_M EssGConnect (hGrid, Server, Username, Password, Application, Database, ulOptions);
| Parameter | Data Type | Description |
|---|---|---|
hGrid | ESSG_HGRID_T | Handle passed back from EssGNewGrid. |
Server | ESSG_SERVER_T | Network server name string. The server name can be expressed as hostname or hostname:port. |
Username | ESSG_USERNAME_T | Name of valid user at server. |
Password | ESSG_PASSWORD_T | Password of user. |
Application | ESSG_APPLICATION_T | Name of a valid application on server. |
Database | ESSG_DATABASE_T | Name of a valid database for application on server. |
ulOptions | ESSG_ULONG_T | 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. |
Notes
Calls EssAutoLogin, therefore all rules that apply to EssAutoLogin apply to this function. For example, none of the parameters are case-sensitive.
If ulOptions is set to ESSG_CONNECT_NODIALOG, none of the connection related parameters can be NULL or empty. When ulOptions is set to ESSG_CONNECT_DEFAULT, and a buffer is passed for the connect parameters, the user's selections from the dialog will be returned in these buffers.
All security information is utilitized. Therefore, if the user connects to a database to which he or she does not have read access, all read operations will fail.
Return Value
If successful, returns ESSG_STS_NOERR.
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