다음을 통해 공유


EventConnection Property

Topic Last Modified: 2006-06-13

The Microsoft® ActiveX® Data Objects (ADO) Connection object for the current event. This property is read-only.

Applies To

IExStoreDispEventInfo Interface

Type Library

EXOLEDB Type Library

DLL Implemented In

EXOLEDB.DLL

Syntax

Property EventConnection As Object
HRESULT get_EventConnection(IDispatch** pConnection);

Parameters

  • pConnection
    Upon successful return, the passed address contains a valid IDispatch object reference on the ADO Connection object used to bind to the store.

Remarks

This property returns the IDispatch interface pointer for the ADO Connection object created in the context of the event. This method is similar to the GetEventSession Method, except that OLE Automation-compatible ADO objects and interfaces are returned rather than OLE DB objects and interfaces.

For synchronous events, the event session executes within a local transaction. For an asynchronous event, the object is created implicitly using an IBindResource::Bind call. The object is created within the security context of the default user. Access is limited to the event item.

Example


Private Sub IExStoreAsyncEvents_OnSave( _
  ByVal pEventInfo as ExevtsnkLib.IExStoreEventInfo, _
  ByVal bstrURLSource as String, _
  ByVal lFlags as Long _
)

  ' Get an OA compatible interface
  Dim iDispEvtInfo as IExStoreDispEventInfo
  Set iDispEvtInfo = pEventInfo

  ' Get the Connection used for the event
  Dim Conn as ADODB.Connection
  Set Conn = iDispEvtInfo.EventConnection
  ' ...
End Sub