access microsoft exchange server users inbox data using asp.net
-
i am software developer my client want to access exchange server users data through web application I create asp.net application on the same machine where exchange server is install the follwoi8ng code ,applied in application ================================================ Dim cURL As String Sub FindMsgsFrom(ByVal sender, ByVal Conn) Const adErrNoCurrentRecord = 3021 Dim FolderURL As String FolderURL = "Inbox" Dim strq As String Dim rs As ADODB.Recordset rs = CreateObject("ADODB.Recordset") 'construct the SQL query, note the scope for deep traversal strq = "SELECT ""urn:httpmail:subject"" " strq = strq & "FROM scope('shallow traversal of """ & FolderURL & """ ')" ' strq = strq & "WHERE ""urn:schemas:httpmail:sendername"" = '" & sender & "'" rs.Open(strq, Conn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockReadOnly, -1) 'If empty recordset, return error 'If successful call DoResults routine passing the recorset If rs.EOF = True Then On Error Resume Next Err.Raise(adErrNoCurrentRecord) Response.Write("No items found, run another query.") Else Response.Write("Success! Found " & rs.RecordCount) DoResults(rs) End If rs.Close() End Sub Function DoResults(ByVal Rs As ADODB.Recordset) 'If empty recordset, return error Dim f As ADODB.Field If Rs.EOF = True Then 'On Error Resume Next 'Err.Raise(adErrNoCurrentRecord) Response.Write("
No items found, run another query.") Else Rs.MoveFirst() Do Until Rs.EOF 'Create a HTML table for each record, make table headings stand out Response.Write("") Response.Write("") Response.Write("") For Each f In Rs.Fields 'for every field in the record Response.Write("
Property
Value
") Response.Write(f.Name) Response.Write("
") 'accommodate null and multivalued properties If Not IsD
-
i am software developer my client want to access exchange server users data through web application I create asp.net application on the same machine where exchange server is install the follwoi8ng code ,applied in application ================================================ Dim cURL As String Sub FindMsgsFrom(ByVal sender, ByVal Conn) Const adErrNoCurrentRecord = 3021 Dim FolderURL As String FolderURL = "Inbox" Dim strq As String Dim rs As ADODB.Recordset rs = CreateObject("ADODB.Recordset") 'construct the SQL query, note the scope for deep traversal strq = "SELECT ""urn:httpmail:subject"" " strq = strq & "FROM scope('shallow traversal of """ & FolderURL & """ ')" ' strq = strq & "WHERE ""urn:schemas:httpmail:sendername"" = '" & sender & "'" rs.Open(strq, Conn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockReadOnly, -1) 'If empty recordset, return error 'If successful call DoResults routine passing the recorset If rs.EOF = True Then On Error Resume Next Err.Raise(adErrNoCurrentRecord) Response.Write("No items found, run another query.") Else Response.Write("Success! Found " & rs.RecordCount) DoResults(rs) End If rs.Close() End Sub Function DoResults(ByVal Rs As ADODB.Recordset) 'If empty recordset, return error Dim f As ADODB.Field If Rs.EOF = True Then 'On Error Resume Next 'Err.Raise(adErrNoCurrentRecord) Response.Write("
No items found, run another query.") Else Rs.MoveFirst() Do Until Rs.EOF 'Create a HTML table for each record, make table headings stand out Response.Write("") Response.Write("") Response.Write("") For Each f In Rs.Fields 'for every field in the record Response.Write("
Property
Value
") Response.Write(f.Name) Response.Write("
") 'accommodate null and multivalued properties If Not IsD
hi, try to run the aspnet process with system permission (by changing the processmodel setting in the machine.config file) and see it it works. -Manish