Microsoft KB Archive/255075

From BetaArchive Wiki
Knowledge Base


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:

  1. 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

  2. Start Exchange System Manager, and click to expand the Administrative Groups container to see the Administrative Group node.
  3. Right-click the Folders container of the Administrative Group, click New, click Public Folder Tree, and then name the new public folder tree MyNewTree.
  4. Expand the Server container of the Administrative Group, and then click the Storage Group of the server where the folder store will be kept.
  5. Right-click the Storage Group, click New, and then click Public Store.
  6. On the General page, name the new public store NewPubStore, and then click Browse to associate MyNewTree with it.
  7. 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?

  8. Click OK after you mount the store.
  9. Expand the Folders folder, right-click MyNewTree, point to New, and then click Public Folder.
  10. Type MyNewFolder in the Name field, and then click OK.
  11. Use Microsoft Outlook to place items into the MyNewFolder public folder in the MyNewTree public store.

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