Exchange Server2003: Programming Tecnologies
Exchange Server2003: Programming Tecnologies
Microsoft® Exchange Server 2003 enables information workers to gain access to critical business
communications almost whenever and wherever they need to and is designed to deliver greater security,
availability, and reliability. Exchange 2003 sets a new benchmark for low total cost of ownership (TCO) by
helping your information technology (IT) staff to do more with less through improved management tools.
Exchange 2003 is seamlessly integrated with the Microsoft Windows® 2000 and 2003 operating systems
and provides a robust development platform for designing, implementing, and deploying collaborative
applications. Browse the Exchange 2003 developer documentation in this section and discover how
/////////////////////////////////////////////////////////////////////////////////////////////////////
Programming tecnologies
ADO
The Microsoft ActiveX Data Objects (ADO) 2.5 object model is simple in design and has only a few objects. The following sections are a
summary of the ADO objects most commonly used to access the Exchange store.
Connection
Use the ADO Connection object to bind to a particular public or private store, handle transactions, and share across Record and Recordset
objects to avoid continually rebinding to stores. For example:
Conn.Provider = "ExOLEDB.DataSource"
Conn.Open RootFolderURL
Conn.BeginTrans
' ..
Conn.CommitTrans
' ..
Conn.Close
Rec.Close
Placing Connection object references in ASP Session or Application objects and reusing this connection from one ASP page to another is ideal
for optimal server-side performance.
You need a separate Connection object to bind to items in a different Exchange store mailbox store or public store. To avoid poor
performance, you should reuse these Connection objects whenever possible. For example:
Conn1.Provider="exoledb.datasource"
Conn1.Open "http://servername/vroot1"
Conn2.Provider="exoledb.datasource"
Conn2.Open "http://servername/vroot2"
Rec.Close
'...
'... Conn1.Close Conn2.Close Rec.Close Set Conn1 = Nothing Set Conn2 = Nothing Set Rec = Nothing
Fields/Field
Use the ADO Fields collection and the ADO Field object to access an item's properties. For example:
Url = "http://server/public/test/item.eml"
Conn.Provider = "ExOLEDB.DataSource"
Conn.Open Url
'...
Next Fld
' ...
Conn.Close
Rec.Close
Record
Use the Record object to access any item in the Exchange store. You have full access to the item's set of properties and its associated stream.
For example:
Dim Rec As New ADODB.Record
Conn.Provider = "ExOLEDB.DataSource"
Conn.Open "http://server/folder"
'...
Conn.Close
Rec.Close
Recordset
Use the Recordset object to issue Structured Query Language (SQL) SELECT commands in folders. For example:
Conn.Provider = "ExOLEDB.DataSource"
Conn.Open RootFolderURL
'...
Conn.Close
Rs.Close
Set Rs = Nothing
Stream
Use the ADO Stream object to access an item's stream. For example:
Url = "http://server/public/item.txt"
Conn.Provider = "ExOLEDB.DataSource"
Conn.Open Url
'...
Conn.Close
Rec.Close
Stm.Close
Stm2.Close
Each of the following Collaboration Data Objects (CDO) objects provides an ADO Fields collection on its default interface, allowing you to
access Exchange store item properties directly, as if the object was an ADO Record or Recordset object:
Addressee CoClass
Appointment CoClass
Configuration CoClass
Folder CoClass
Item CoClass
Message CoClass
Person CoClass
/////////////////////////////////////////////
ADSI
Active Directory Service Interfaces (ADSI) abstract the capabilities of directory services from different network providers to present a
single set of directory service interfaces for managing network resources. Microsoft Exchange Server 2003 messaging and collaboration
applications can use ADSI to look up and modify user and group information stored in Microsoft Active Directory. For more information
about ADSI, see the MSDNActive Directory Service Interfaces Web site.
/////////////////////////////
ExOLEDB
Microsoft Exchange Server 2003 provides a new, high-performance OLE DB provider that you can use on the local server to access Exchange
store items: the Exchange OLE DB (ExOLEDB) provider. Through the ExOLEDB provider, programmers can access the Exchange store using
OLE DB, Microsoft ActiveX Data Objects (ADO), and Collaboration Data Objects (CDO).
The following illustration shows the relationship between ADO, CDO, OLE DB, the ExOLEDB provider, and the Exchange store.
The ExOLEDB provider is a server-side component, and is therefore used only to access public stores and mailbox stores that reside on the
same server. You can, however, access data on the server remotely by wrapping functionality into Component Object Model (COM)
components, which can be utilized by ASP and other Web applications. The ExOLEDB provider is also ideal for use in COM+ components and
Exchange store event and workflow sinks that run on the server. To access remote public stores and mailbox stores, use the WebDAV
Exchange registers this provider for the file URL namespace with the OLE DB 2.5 root binder on the local server. The root binder eliminates
the requirement to explicitly specify an ADO Connection object when accessing items through OLE DB. This means that you can bind an ADO
Record object directly to an item only by using a file-type URL. To bind to items by using The HTTP: URL Scheme through the ExOLEDB
provider, you must specify the ExOLEDB provider binder with an ADO Connection object (Connection.Provider = "ExOLEDB.DataSource"). In
The following section summarizes how specific ADO objects can be used effectively in Exchange store applications:
ADO
/
///////////////////////////////////
STORED EVENTS
Events Overview
• When Exchange store items are saved, deleted, moved, copied, or modified.
You can write event sinks that can receive notification of these events.
Typical Applications
Timers
You can register to receive event notifications at specified times. You can use timers to synchronize information external to the store, to clean
up the store periodically, to remind people of pending tasks, or to trigger batch processing.
Notifications
You can register to receive an event notification, and use an event sink to notify other parties that the event has occurred.
Automatic Categorization
You can use event sinks to analyze and categorize items that are saved to the store. This ensures that data is properly stored and that
Workflow Applications
You can register to receive event notifications when workflow items are moved in the Exchange store. The event sink can handle the
Item Validation
Event sinks can validate or check items when they are saved to the store. The event sink might process a delete notification by checking a
custom criterion to see if the person deleting the item has the rights to do so. When a save event occurs, you might check the formatting of
Store maintenance
Whenever an item is deleted from a particular location in the store, other items that are outside the Exchange store might need to be
modified or deleted. You can program event sinks to handle these tasks automatically.