EPLAN.EPLAN21.DATABASE.CLOSE_SLAVE

Contents

Description

Command for interrupting the connection between an EPLAN 21 subdatabase and the working set and for closing the subdatabase.
The subdatabase as well as the associated main database must already be open and have to be locked for exclusive editing.

The EPLAN.EPLAN21.DATABASE.CLOSE_SLAVE command is called up via the API functions as specified in the EPLAN 21 API.

Parameters

All parameters have the prefix "EPL_PARAM_DATABASE_CLOSE_SLAVE_".

ParameterID Type Description
DBNAME [IN]
String

Name of the subdatabase to be closed.

The command interrupts the connection between this subdatabase and its main database, and thus removes it from the working set. Furthermore, the subdatabase will be closed.

Error Messages

The eplExecuteCommand function returns EPL_OK if the subdatabase was closed correctly.

ErrorID Description
EPL_ERR_DATABASE_CLOSE_SLAVE_INVALID_MASTER

The transferred database name is either invalid (empty), or no working set could be found for this name.

EPL_ERR_DATABASE_CLOSE_SLAVE_INVALID_SLAVE

No working set could be found for the transferred database name.

EPL_ERR_DATABASE_CLOSE_NOTALLOWED

A client prohibits the closing of the database.

EPL_ERR_DATABASE_CLOSE_SLAVE_DB_MASTERNOTOPEN

The main database of the working set is not open.

EPL_ERR_DATABASE_CLOSE_SLAVE_DB_MASTERNOTLOCKED

The main database of the working set is not locked for exclusive editing.

EPL_ERR_DATABASE_CLOSE_SLAVE_DB_NOTOPENED

The subdatabase is not open.

EPL_ERR_DATABASE_CLOSE_SLAVE_DB_NOTLOCKED

The subdatabase is not locked for exclusive editing

Example

The following example shows how to remove a subdatabase from a working set and how to close it.

EplHandle
closeSlaveDatabase(EplSession s)
{
        EplHandle ret = EPL_ERROR;

        // Create command:
        EplHandle cmd =
                eplCreateCommand(s, "EPLAN.EPLAN21.DATABASE.CLOSE_SLAVE");

        // Could the command be created?
        if(cmd != EPL_ERROR)
        {
		// Set database name:
		eplSetParam(
			s,
			cmd,
			EPL_PARAM_DATABASE_CLOSE_SLAVE_DBNAME,
			L"c:\\tmp\\test_slave.db"
			0);
                ret = eplExecuteCommand(s, dbCommand);
        }

        eplCloseObject(s, dbCommand);
        return ret;
}

Reference