Share via


UnlockObject (Command Interface)

Note

  This feature will be removed in the next version of Microsoft SQL Server. Do not use this feature in new development work, and modify applications that currently use this feature as soon as possible.

The UnlockObject method of the Command interface releases the lock previously established on a command object by the LockObject method.

Applies To:clsDatabaseCommand

Syntax

object.UnlockObject

Parameters

  • object
    The object to unlock.

Remarks

If an application that created one or more locks terminates before it can free them using the UnlockObject method, the Analysis server automatically releases the locks when the connection with the application is closed.

Example

The following example locks a command object so that it can be modified. It then unlocks the object and updates its repository information.

'Assume a command object (dsoCmd) exists.
dsoCmd.LockObect OlapLockRead, "Updating command, please wait."
' (Insert code to change command object here.)
dsoCmd.Update
dsoCmd.UnlockObject

See Also

Reference

Command Interface

Help and Information

Getting SQL Server 2005 Assistance