EssGConnect

グリッドをEssbaseデータベースに接続します。

構文

            ESSG_FUNC_M 
            EssGConnect
             (
            hGrid, Server, Username, Password, Application, 
Database, ulOptions
            );
         
パラメータデータ型説明

hGrid

ESSG_HGRID_T

EssGNewGridから戻されるハンドル。

Server

ESSG_SERVER_T

ネットワーク・サーバー名の文字列。

サーバー名はhostnameまたはhostname:portで表すことができます。

Username

ESSG_USERNAME_T

サーバー上の有効なユーザー名。

Password

ESSG_PASSWORD_T

ユーザーのパスワード。

Application

ESSG_APPLICATION_T

サーバー上の有効なアプリケーション名。

Database

ESSG_DATABASE_T

サーバー上にあるアプリケーションにおいて有効なデータベース名。

ulOptions

ESSG_ULONG_T

オプションのフラグ。値は、ダイアログを表示せずデフォルト、または渡された設定を使用してログインと接続を試行する場合はESSG_CONNECT_NODIALOGになります。ログインおよび選択のダイアログを表示する場合はESSG_CONNECT_DEFAULTになります。

備考

戻り値

正常終了の場合は、ESSG_STS_NOERRが戻されます。

アクセス

なし。

         #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);
}
      

関連トピック