UnlockObject (Command Interface)

[!附註]

  下一版的 Microsoft SQL Server 將不再提供此功能。請勿在新的開發工作中使用此功能,並且儘速修改使用此功能的應用程式。

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

Applies To:clsDatabaseCommand

語法

object.UnlockObject

參數

  • object
    The object to unlock.

備註

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.

範例

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

請參閱

參考