When a Microsoft Exchange OLE DB (ExOLEDB) provider-based event sink
uses the
OnSave event function of the
IExStoreAsyncEvents interface, the
OnSave
event function returns a
pEventInfo parameter of an
IExStoreEventInfo object. You
can obtain an opened connection by casting the
IExStoreEventInfo object to a
type
IExStoreDispEventInfo. Then, obtain the
EventConnection property of the
IExStoreDispEventInfo object. For more information, see the following Microsoft Visual Basic code 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 that is used for the event.
Dim Conn as ADODB.Connection
Set Conn = iDispEvtInfo.EventConnection
' ...
End Sub
If you use this connection to run a deep traversal query in the right
scope, you receive the following error message:
Specified resource is
out-of-scope.