- The ADO/OLE DB Conspiracy
- What Does ADO 2.5 Have to Do with Exchange 2000?
- The Role of the Web Storage System
- The Exchange OLE DB Provider
- File URLs
- HTTP URLs
- Programmatically Getting a User's HTTP Mailbox Folder URLs
- The Open Method of the ADO 2.5 Record Object
- Using Web Storage System SQL to Get a List of Folders
- Web Storage System SQL
- The SELECT Statement
- The ORDER BY Clause
- The RANK BY Clause
- Some Unsupported SQL
- Summary
File URLs
In case you haven't heard already (tongue planted firmly in cheek), every item in Exchange 2000 is accessible via a URL. All programming tasks in Exchange are also URL based. When dealing with the Exchange OLE DB provider, you can use either "file://" or "http://" URLs. Let's look at the ground rules for each.
Your file URL can take two forms, depending on what you want to access. Use this one when you want to access a private mailbox:
file://./backofficestorage/<domain-name>/MBX/<user-alias>/<path>
Use this one when you want to access a public folder tree:
file://./backofficestoreage/<domain-name>/<public-folder-tree-name>/<path>
In both forms:
-
domain-name refers to the fully qualified domain in which the store resides (e.g., "mydomain.local" or "somedomain.plural.com").
-
public-folder-tree-name refers to the public folder tree in which the item resides. Several values can be used here. "Public Folders" is the default folder tree name for the backward-compatible MAPI public folder hierarchy that you see under All Public Folders in Outlook. Elsewhere in the book we talk about top-level hierarchies (TLHs), which are new public folder trees that you can create. If you create a TLH, you can use its name here. You can also use the string "MBX" to refer to the private mailbox store.
-
user-alias refers to a user's Exchange mailbox alias (i.e., "gomeza" in our example).
-
path is the folder path to the item, consisting of folder names separated by "/", just like any other folder path.
Some examples will help illustrate. For example, Table 7.2 shows how to access the standard default mailbox folders using file URLs.
Table 7.2 Default Mailbox Folder File URLs
Folder | URL |
---|---|
Calendar | file://./backofficestorage/<domain-name>/MBX/<user-alias>/Calendar |
Contacts | file://./backofficestorage/<domain-name>/MBX/<user-alias>/Contacts |
Drafts | file://./backofficestorage/<domain-name>/MBX/<user-alias>/Drafts |
Inbox | file://./backofficestorage/<domain-name>/MBX/<user-alias>/Inbox |
Journal | file://./backofficestorage/<domain-name>/MBX/<user-alias>/Journal |
Notes | file://./backofficestorage/<domain-name>/MBX/<user-alias>/Notes |
Outbox | file://./backofficestorage/<domain-name>/MBX/<user-alias>/Outbox |
Sent Items | file://./backofficestorage/<domain-name>/MBX/<user-alias>/Sent%20Items |
Tasks | file://./backofficestorage/<domain-name>/MBX/<user-alias>/Tasks |
Similarly, if we wanted to access a brand-new TLH called The Web Storage System that we had created on our local Exchange 2000 server, we could use the following URL:
file://./backofficestorage/mydomain.local/The%20Web%20Storage%20System/
If we created a new public folder called Exchange Book Talk under the default Exchange public store, we could use the URL
file://./backofficestorage/Public%20Folders/Exchange%20Book%20Talk
Note: When using the "file://" URL namespace to refer to Exchange items, you do not need to explicitly specify the Exchange OLE DB provider. To avoid confusion, however, you should always explicitly open a connection and set the provider as shown earlier in the chapter. |