Searching the Exchange Store

Searching the Exchange Store

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

This section contains common search tasks used with the Exchange store. The examples in this section use the Microsoft® ActiveX® Data Objects (ADO) 2.5 Component Object Model (COM) component running on the same computer as the Exchange store.

The search condition scope for most of these tasks is a shallow traversal, which is the default scope if no scope is specified. The Simple Query programming task contains commented code to show how to explicitly specify a shallow traversal. You can also search subfolders using the methods found in Specifying a Deep Traversal if the search is not being done within a MAPI  public store. Attempting to do a deep traversal search on a MAPI store will cause a run-time error.

Note that calculated properties are Non-Searchable Properties and should not be used in the SELECT Statement of the Structured Query Language (SQL) query.

You can improve search performance by employing the following techniques:

  • Take advantage of the Exchange store by Using Full-Text Indexing.
  • Using Relative URLs to improve performance and simplify coding.
  • Pass one ADO Connection object to routines that open recordsets and process search results.
  • If you are searching on a property that you defined with a property definition, you should use the CAST Function to cast its data type to a known XML data type to ensure that it will be recognizable by the Exchange store. Custom strings and Boolean properties, however, do not require casting.
  • Use the RANK BY Clause to sort results based on how frequently and where the queried strings appear in the indexed documents.
  • Use the ORDER BY Clause to sort the returned recordset in ascending or descending order according to one or more properties specified.

This section consists of the following topics:

Simple Query

Specifying a Deep Traversal

Word and Character Matching

Specifying a Date Range

Getting Item Counts with GROUP BY

Enumerating Search Results

Searching Folders (WebDAV)

Searching Calendar Folders with WebDAV

Specifying Row Ranges in a Search

Rendering Search Results with XSL

Searching/Listing Items Using ADO

Searching/Deleting Using ADO

Modifying Objects Using CDOEX and ADO

Creating Search Folders

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.