Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

You receive a "Specified resource is out-of-scope" error message when you run a deep traversal query by using a connection that you obtained from the event function of the event sink


View products that this article applies to.

Symptoms

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.

↑ Back to the top


Workaround

To work around this issue, use one the following methods:
  • Open a new connection in the event sink.
  • Use a hierarchical traversal query and a shallow traversal query.

↑ Back to the top


Keywords: KB895524, kbinfo, kbprb, kbexchdev

↑ Back to the top

Article Info
Article ID : 895524
Revision : 4
Created on : 10/25/2007
Published on : 10/25/2007
Exists online : False
Views : 258