You are on page 1of 8

EXCHANGE SERVER2003

Microsoft Exchange Server 2003

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

Exchange 2003 can streamline your collaborative application development.

/////////////////////////////////////////////////////////////////////////////////////////////////////

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:

Dim Conn as New ADODB.Connection

Conn.Provider = "ExOLEDB.DataSource"

Conn.Open RootFolderURL

Conn.BeginTrans

Rec.Open ItemURL, Conn, adModeReadWrite

' ..

Conn.CommitTrans
' ..

Conn.Close

Rec.Close

Set Conn = Nothing

Set Rec = Nothing

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:

Dim Conn1 as New ADODB.Connection

Dim Conn2 as New ADODB.Connection

Dim Rec as New Record

' Assume /vroot1 is mapped to one public store and

' /vroot2 is mapped to another.

Conn1.Provider="exoledb.datasource"

Conn1.Open "http://servername/vroot1"

Conn2.Provider="exoledb.datasource"

Conn2.Open "http://servername/vroot2"

Rec.Open "http://servername/vroot1/folder1/item.eml", Conn1, adModeReadWrite

Rec.Close

'...

Rec.Open "http://servername/vroot_2/folder2/item2.eml", Conn2, adModeReadWrite

'... 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:

Dim Rec as New ADODB.Record

Dim Conn as New ADODB.Connection

Dim Flds as ADODB.Fields

Dim Fld as ADODB.Field

Dim Url As String

Url = "http://server/public/test/item.eml"

Conn.Provider = "ExOLEDB.DataSource"

Conn.Open Url

Rec.Open Url, Conn, adModeReadWrite

Set Flds = Rec.Fields

For Each Fld in Flds

'...

Next Fld

' ...

Conn.Close

Rec.Close

Set Conn = Nothing

Set Rec = Nothing

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

Dim Conn as New ADODB.Connection

Dim Stm as ADODB.Stream

Conn.Provider = "ExOLEDB.DataSource"

Conn.Open "http://server/folder"

Rec.Open "http://server/folder/item.txt", Conn

Set Stm = Rec.Fields(adDefaultStream).Value

'...

Conn.Close

Rec.Close

Set Conn = Nothing

Set Rec = Nothing

Recordset
Use the Recordset object to issue Structured Query Language (SQL) SELECT commands in folders. For example:

Dim Conn as New ADODB.Connection

Dim Rs as New ADODB.Recordset

Conn.Provider = "ExOLEDB.DataSource"

Conn.Open RootFolderURL

Set Rs.ActiveConnection = Conn

"select ""DAV:displayname"" " _

& "from scope('shallow traversal of ""URL""')" _

& "Where ""DAV:ishidden"" = False"

'...
Conn.Close

Rs.Close

Set Conn = Nothing

Set Rs = Nothing

Stream
Use the ADO Stream object to access an item's stream. For example:

Dim Stm As ADODB.Stream

Dim Rec as New ADODB.Record

Dim Conn as New ADODB.Connection

Dim Stm2 as New ADODB.Stream

Dim Url As String

Url = "http://server/public/item.txt"

Conn.Provider = "ExOLEDB.DataSource"

Conn.Open Url

Rec.Open Url, Conn

Set Stm = Rec.Fields(adDefaultStream).Value

' Or, alternately

Stm2.Open Rec, adModeRead, adOpenStreamFromRecord

'...

Conn.Close

Rec.Close

Stm.Close
Stm2.Close

Set Conn = Nothing

Set Rec = Nothing

Set Stm = Nothing

Set Stm2 = Nothing

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

protocol, MAPI, or CDO 1.2.1.

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

most cases, it is best that you specify this provider explicitly.

The following section summarizes how specific ADO objects can be used effectively in Exchange store applications:

ADO

/
///////////////////////////////////

STORED EVENTS
Events Overview

Exchange store events occur:

• When Exchange store items are saved, deleted, moved, copied, or modified.

• When a store is started or shut down.

• When a specific time interval has elapsed.

You can write event sinks that can receive notification of these events.
Typical Applications

Typical applications that use event sinks include the following.

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

information about the data is kept current.

Workflow Applications

You can register to receive event notifications when workflow items are moved in the Exchange store. The event sink can handle the

workflow item programmatically as it proceeds along its workflow path.

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

the item being saved.

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.

You might also like