# EssGDisconnect

Description

EssGDisconnect() disconnects a grid from a database at the server.

Syntax

    ESSG_FUNC_M EssGDisconnect (hGrid, ulOptions);

ESSG_HGRID_T | hGrid
ESSG_ULONG_T | ulOptions

Parameters

hGrid | Handle passed back from EssGNewGrid.
ulOptions | Reserved for future use. Should be set to zero.

Return Value

If successful, returns ESSG_STS_NOERR.

Notes

- None.

Example

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

    ESSG_FUNC_M     sts = ESS_STS_NOERR;
    ESSG_ULONG_T    ulOptions = 0;
    ESSG_INIT_T     InitStruct;
    ESSG_HANDLE_T   Handle;
    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);

    /* connects the grid to a database on the server */
    if(!sts)
       sts = EssGConnect(hGrid, "Rainbow", "Admin",
             "Password", "Demo", "Basic",
             ESSG_CONNECT_DEFAULT);

    /* disconnects a grid from database at server */
    if(!sts)
       sts = EssGDisconnect(hGrid, ulOptions);

    /* terminate the EGAPI */
    if(!sts)
       sts = EssGTerm(Handle);
    }

See Also

Using the Grid API Functions
Grid API Structures