Microsoft KB Archive/255075

= How to perform a deep traversal search on a non-MAPI public folder tree =

Article ID: 255075

Article Last Modified on 10/27/2006

-

APPLIES TO


 * Microsoft Exchange 2000 Server Standard Edition
 * Microsoft ActiveX Data Objects 2.5

-



This article was previously published under Q255075



SUMMARY
This article explains how to create a non-MAPI public folder tree and perform a deep traversal search on it by using ActiveX Data Objects (ADO).



MORE INFORMATION
To create a non-MAPI public folder store:  Follow the procedure in the following Microsoft Knowledge Base article to make the Administrative Groups container visible in Exchange System Manager:

242561 How to make Administrative Groups/Routing Groups containers visible in Exchange System Manager

 Start Exchange System Manager, and click to expand the Administrative Groups container to see the Administrative Group node. Right-click the Folders container of the Administrative Group, click New, click Public Folder Tree, and then name the new public folder tree MyNewTree. Expand the Server container of the Administrative Group, and then click the Storage Group of the server where the folder store will be kept. Right-click the Storage Group, click New, and then click Public Store. On the General page, name the new public store NewPubStore, and then click Browse to associate MyNewTree with it. Click OK, and then click Yes when you receive the following message:

The new store was created successfully. Do you want to mount it now?

</li> Click OK after you mount the store.</li> Expand the Folders folder, right-click MyNewTree, point to New, and then click Public Folder.</li> Type MyNewFolder in the Name field, and then click OK.</li> Use Microsoft Outlook to place items into the MyNewFolder public folder in the MyNewTree public store.</li></ol>

To perform a deep traversal search on MyNewTree, try the following sample code: 'make a reference to Microsoft ActiveX Data Objects 2.5 Library and 'Active DS Type Library

Private Sub DeepTraversal_Click Dim Info As New ADSystemInfo Dim sDomainName As String Dim sFolderURL As String Dim sSQL As String Dim Rs As New ADODB.Recordset Dim Rec As New ADODB.Record sDomainName = Info.DomainDNSName sFolderURL = "file://./backofficestorage/" & sDomainName & "/MyNewTree"

Rec.Open sFolderURL sSQL = "Select * " sSQL = sSQL & " from scope ('deep traversal of " & Chr(34)   sSQL = sSQL & sFolderURL & Chr(34) & "')" Rs.Open sSQL, Rec.ActiveConnection If Not Rs.EOF Then Rs.MoveFirst End If   While Not Rs.EOF Debug.Print Rs.Fields("DAV:displayname").Value Rs.MoveNext Wend Rs.Close Rec.Close End Sub

Additional query words: XCLN CDOEX

Keywords: kbhowto KB255075

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.