Viewing the Calendar Using ADO
Viewing the Calendar Using ADO
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.
VBScript
Note The following example uses a file URL with the Exchange OLE DB (ExOLEDB) provider. The ExOLEDB provider also supports The HTTP: URL Scheme. Using The HTTP: URL Scheme allows both client and server applications to use a single URL scheme.
'Viewing the Calendar using ADO --> <!-- 'Steps to test this sample. '1) Create a folder named "test" under inetpub/wwwroot. '2) Save the above file in that folder with the mantioned name. '3) Make the changes to the above file i.e. Change the strLocalPath and DomainName variables to reflect your mailbox and domain. '4) Save the file. '5) open internet service manager and browse to the "test" folder '6) right click and go to properties '7) go to the "Directory Security" tab. '8) Click on "Edit" button next to the "handshake" icon '9) Uncheck "Anonymous Access" '10) check the "Digest Authentication" and "Integrated windows authentication" boxes '11) click ok '12) click ok '13) Load the asp in the browser. --> <%@ Language=VBScript %> <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> <TITLE></TITLE> </HEAD> <BODY > <% 'Viewing the Calendar using WebDAV. 'Set the required permissions on Exchange 2000 Server and IIS Dim CalendarURL Dim ItemURL Dim Rs Dim Rec Dim Conn Dim iAppt Dim dateStartDate Dim Subject Dim DomainName Dim strLocalPath 'specify your own domain DomainName = "mydomain.fourthcoffee.com" 'specify a URL to folder or item strLocalPath = "MBX/User1/Calendar" Set Rec = CreateObject("ADODB.Record") Set Rs = CreateObject("ADODB.Recordset") strURL = "file://./backofficestorage/" & DomainName & "/" & strLocalPath Rec.Open strURL Set Rs.ActiveConnection = Rec.ActiveConnection Rs.Source = "SELECT ""DAV:href"", " & _ " ""urn:schemas:httpmail:subject"", " & _ " ""urn:schemas:calendar:dtstart"", " & _ " ""urn:schemas:calendar:dtend"" " & _ "FROM scope('shallow traversal of """ & strURL & """') " Rs.Open Rs.MoveFirst %> <FONT FACE=ARIAL SIZE=2> <br><br> <TABLE cellspacing=0 cellpadding=4> <tr><td>Subject:</td><td>Start:</td><td>end:</td></tr> <% Do Until Rs.EOF response.write "<tr><td>" Response.Write Rs.Fields("urn:schemas:httpmail:subject").Value response.write "</td><td>" Response.Write Rs.Fields("urn:schemas:calendar:dtstart").Value response.write "</td><td>" Response.Write Rs.Fields("urn:schemas:calendar:dtend").Value response.write "</td><td>" Rs.MoveNext Loop %> </tr> </table> </BODY> </HTML> <!--
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.