You can use MAPI or Incremental Change Synchronization (ICS) as a basis for replicating data into a Microsoft Exchange Server information store from an external database. In either case, you will also use the appropriate database query language to read data from the external database.
This procedure does not address the possibility of replicating data from a Microsoft Exchange Server information store into an external database.
Design Tasks
Decide whether to use ICS or MAPI. ICS applications are more complex to build, but are more efficient and can offer built-in conflict resolution.
If you are designing a new database, consider structuring it so that its elements correspond to distinct elements in the destination Microsoft Exchange Server information store. Each database record will correspond to one message, and each field in a record will correspond to one property in the corresponding message.
Map the information store structure to the database structure. For example, a table in your database may become a public folder called Expense Reports. Map message properties to database fields; individual expense reports (records in the database) become messages in the Expense Reports public folder. Finally, the properties on individual messages map to fields within database records.
Identify each database record unambiguously. You can use the PR_SOURCE_KEY property for this purpose (as each database record's primary key) because this property stays with an object throughout its existence.
If you plan to use ICS, you must support several other properties.
For folders: PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY, PR_DISPLAY_NAME, PR_CHANGE_KEY, and PR_PREDECESSOR_CHANGE_LIST.
For messages: PR_SOURCE_KEY, PR_CHANGE_KEY and PR_PREDECESSOR_CHANGE_LIST.
Because in most cases messages will be stored in public folders, you need to decide whether to make folders read-only. Doing so simplifies your design by avoiding the data loss or conflicts that are caused when data is replicated from the database into messages that users have changed.
Decide which database information will be displayed to users, and if the public folder is read/write, which information users will be permitted to change.
Implementation Tasks
Using the appropriate database query language, implement an application to read changed records from the database. If you are using ICS, implement the ICS synchronizer interface.
Write the code to transfer the data according to your mapping in step 3 of Design Tasks. If you are using ICS, implement an agent that regulates the transfer of data from your synchronizer to the Microsoft Exchange Server ICS collector.
Build a custom form that lets users access the data in the public folder. The form may contain named properties (see the MAPI Programmer's Reference) for each of its fields. These named properties will be specific to the form's message class. This form displays the fields you chose to display in step 7 of Design Tasks. You can also program this or another form to display any fields used for user input, if the public folder is read/write.
Set up the public folder. Although you cannot make a message read-only, you can set a folder to be read-only. (See step 6 of Design Tasks.) Define one or more views on the public folder.