EPLAN.EPLAN21.DATABASE.UNLOCK

Contents

Description

Command for unlocking a database

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

Parameters

All parameters have the prefix "EPL_PARAM_DATABASE_UNLOCK_".

ParameterID Type Description
DBHANDLE [IN]
EplHandle

Name of the database to be unlocked.

The command closes the specified database and reopens it with write access.

RECOVER [IN, OPTIONAL]
Boolean

Recover flag for invalid locks.

1: Invalid locks will be removed.
0: Invalid locks will be retained (default).

Error Messages

The eplExecuteCommand function returns EPL_OK if the database could be correctly unlocked.

ErrorID Description
EPL_ERR_DATABASE_UNLOCK_INVALID_DATABASE

The transferred handle is invalid.

EPL_ERR_DATABASE_UNLOCK_DB_NOTOPENED

The database to be unlocked is not open.

EPL_ERR_DATABASE_UNLOCK_DB_READONLY

The database to be unlocked is write-protected.

EPL_ERR_DATABASE_UNLOCK_LOCKED_BY_OTHER

The database to be unlocked was locked by another client.

Example

The following example shows a function which unlocks an open database.

EplHandle
unlockDatabase(EplSession s, EplHandle dbHandle)
{
        EplHandle ret = EPL_ERROR;

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

        // Could the command be created?
        if(cmd != EPL_ERROR)
        {
		// Set handle of main database
		eplSetParamHandle(
			s,
			cmd,
			EPL_PARAM_DATABASE_UNLOCK_DBHANDLE,
			dbHandle
			0);

                ret = eplExecuteCommand(s, dbCommand);
        }

        eplCloseObject(s, cmd);
        return ret;
}

Reference