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 (895524)



The information in this article applies to:

  • Microsoft Exchange Server 2003 Standard Edition
  • Microsoft Exchange Server 2003 Enterprise Edition
  • Microsoft Exchange 2000 Server

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.

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.

Modification Type:MajorLast Reviewed:6/16/2005
Keywords:kbexchDEV kbprb kbinfo KB895524 kbAudDeveloper