ActiveConnection Property

ActiveConnection Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Contains the session object of the user that initiated the event. This property is read-only.

Applies To

IWorkflowSession Interface

Type Library

Microsoft CDO Workflow Objects for Microsoft Exchange

DLL Implemented In

CDOWF.DLL

Syntax

[Visual Basic]Property ActiveConnection As ADODB.Connection

[C++]HRESULT get_ActiveConnection(_Connection** varActiveConnection);

Parameters

  • varActiveConnection
    Returned reference to a _Connection Interface.

Remarks

You can use this property in Privileged Mode only. Your script gets an error message if you attempt to use this property in Restricted Mode.

The ActiveConnection property contains the Session object of the user that initiated the event. Your workflow script can use this property to access the Exchange store in which the ProcessInstance is running. You can perform transactions in that Exchange store only, according to the rights of the user.

If a workflow transition fails, any changes made with the ActiveConnection property are rolled back. This makes your applications more robust.

The ActiveConnection property is only valid for the Exchange store in which the event occurred. You cannot use the ActiveConnection property for a public folder event to access a user's inbox. Also you cannot use cdoSendUsingExchange to send a message as the user with an ActiveConnection to a public folder, because you must have access to the user's outbox.

Example

This example binds the record object to a document in a public folder tree "as the user" that initiated the state transition. Also, this example uses a file URL with the Exchange OLE DB (ExOLEDB) provider. The ExOLEDB provider also supports The HTTP: URL Scheme.

[Visual Basic]

'Assume rec is an ADODB Record object already created

Rec.Open "file://./backofficestorage/" _ & WorkflowSession.Domain _ & "/public folders/UserFolder/PrivateUserDocument.doc", _ WorkflowSession.ActiveConnection, _ adModeReadWrite, _ adFailIfNotExists

See Also

CdoSendUsing Enum

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.