Gets a database's state structure, which contains user-configurable parameters for the database.
Syntax
ESS_FUNC_M EssGetDatabaseState (hCtx, AppName, DbName, ppDbState);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API context handle |
AppName | ESS_STR_T | Application name |
DbName | ESS_STR_T | Database name |
ppDbState | ESS_DBSTATE_T | Address of pointer to receive allocated database state structure |
Notes
This function can get only a server database's state structure.
The memory allocated for the ppDbState structure must be freed with EssFree().
Return Value
If successful, this function returns a pointer to an allocated database state structure in ppDbState.
Access
To get a database's state structure, the connected user must have at least read access to the database.
Example
ESS_FUNC_M ESS_GetCrType (ESS_HCTX_T hCtx, ESS_HINST_T hInst ) { ESS_FUNC_M sts = ESS_STS_NOERR; ESS_PDBSTATE_T pDbState; ESS_STR_T AppName; ESS_STR_T DbName; AppName = "Sample"; DbName = "Basic"; sts = EssGetDatabaseState (hCtx, AppName, DbName, &pDbState); if (!sts) { if (pDbState) { if (pDbState->CrDbName) { printf ("Currency Conversion Type Member: %s\r\n", pDbState->CrTypeMember); if (pDbState->CrConvType == ESS_CRCTYPE_DIV) printf ("Currency Conversion Type: %s\r\n", "ESS_CRCTYPE_DIV"); else if (pDbState->CrConvType == ESS_CRCTYPE_MULT) printf ("Currency Conversion Type: %s\r\n", "ESS_CRCTYPE_MULT"); } else printf ("No Currency database is set\r\n"); EssFree (hInst, pDbState); } } return (sts); }
See Also