Command for closing the current EPLAN 21 working set.
The EPLAN.EPLAN21.DATABASE.CLOSE command is called up via the API functions as specified in the EPLAN 21 API.
All parameters have the prefix "EPL_PARAM_CLOSEDB_".
ParameterID | Type | Description |
---|---|---|
DBNAME | [IN, OPTIONAL] String |
Name of the main database to be closed. The command closes all databases associated with a working set. |
The eplExecuteCommand function returns EPL_OK if the working set was closed correctly.
If the command is executed without a working set being open, eplExecuteCommand returns the return value EPL_ERROR. The error log will then contain the value EPL_ERR_CLOSEDB_NOT_OPEN.
ErrorID | Description |
---|---|
EPL_ERR_GENERAL |
The specified main database name could not be found in one of the open working sets, or no working set is open. |
EPL_ERR_CLOSEDB_NOT_OPEN | The transferred working set is not opened. |
EPL_ERR_NO_DB_OPEN | There is no open working set.. |
EPL_ERR_DATABASE_CLOSE_NOTALLOWED |
A database client prohibits closing a database. |
The following example shows a function which closes the working set that was opened first. It returns EPL_OK if the command could be executed successfully, otherwise EPL_ERROR.
EplHandle closeDatabase(EplSesssion s) { EplHandle ret = EPL_ERROR; // Create command: EplHandle dbCommand = eplCreateCommand(s, "EPLAN.EPLAN21.DATABASE.CLOSE"); // Could the command be created? if(dbCommand != EPL_ERROR) { ret = eplExecuteCommand(s, dbCommand); } eplCloseObject(s, dbCommand); return ret; } |