The AcquireConnection method allows a task to acquire exclusive ownership of a connection to an OLE DB service provider.
[Value =] Connection.AcquireConnection(TaskName)
Part | Description |
---|---|
Connection | Expression that evaluates to an object in the Applies To list |
TaskName | Name of the task that is to acquire the connection |
Value | Boolean that indicates whether the connection was acquired |
When an application calls Connection.AcquireConnection, the InUse property is set to TRUE. The call fails if another task owns the connection. A task releases a connection by calling the ReleaseConnection method. This method is required only if you are creating a custom task.
All tasks must include calls to AcquireConnection and ReleaseConnection. The tasks supplied with Microsoft® SQL Server™ 2000 already include them.
HRESULT AcquireConnection(
BSTR TaskName,
LPUNKNOWN *pRetVal);