AcquireConnection Method

DTS Programming

DTS Programming

AcquireConnection Method

The AcquireConnection method allows a task to acquire exclusive ownership of a connection to an OLE DB service provider.

Applies To
Connection Object Connection2 Object
Syntax

[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

Remarks

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.

Prototype (C/C++)

HRESULT AcquireConnection(
    BSTR TaskName,
    LPUNKNOWN *pRetVal);

See Also

Creating DTS Package Objects and Connections

InUse Property

ReleaseConnection Method