Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: 25 Feb 2006 22:16:22 -0800,    group: microsoft.public.exchange2000.development        back       


Query working only on my mailbox   
Hello,

I'm using the following query to locate incoming messages on a mailbox:

    Dim urlInbox As String =
"http://myserver/Exchange/mymailbox/Inbox/"
    Dim adoCnx As New ADODB.Connection
    adoCnx.Provider = "MSDAIPP.DSO"
    adoCnx.Open(urlInbox)
    Dim adoRsMsgs As New ADODB.Recordset
    adoRsMsgs.ActiveConnection = adoCnx
    Dim strSQL As String = _
      "SELECT ""urn:schemas:httpmail:subject"", " & _
             """urn:schemas:mailheader:date"", " & _
             """urn:schemas:httpmail:textdescription"" " & _
      "FROM """ & urlInbox & """ " & _
      "WHERE ""urn:schemas:httpmail:subject"" = 'MO SMS delivery
message' " & _
      "ORDER BY ""urn:schemas:mailheader:date"" DESC"
    adoRsMsgs.Open(strSQL)
    Do While Not adoRsMsgs.EOF
      ... More processing here ...
    Loop

This code doesn't work on other mailboxes (on which I have user
permissions and can open both in Outlook and OWA). What am I missing?

TIA
date: 25 Feb 2006 22:16:22 -0800   author:   unknown

Re: Query working only on my mailbox   
Do you get an errors when you run the code ?

MSDAIPP.DSO use's webdav as the underlying mechanism to access the Exchange 
Store you might want to try a direct WebDAV query instead see 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_exch2k_searching_folders_http.asp . 
This will allow you to see what errors are being generated if any.

Cheers
Glen

 wrote in message 
news:1140934582.194861.202760@j33g2000cwa.googlegroups.com...
> Hello,
>
> I'm using the following query to locate incoming messages on a mailbox:
>
>    Dim urlInbox As String =
> "http://myserver/Exchange/mymailbox/Inbox/"
>    Dim adoCnx As New ADODB.Connection
>    adoCnx.Provider = "MSDAIPP.DSO"
>    adoCnx.Open(urlInbox)
>    Dim adoRsMsgs As New ADODB.Recordset
>    adoRsMsgs.ActiveConnection = adoCnx
>    Dim strSQL As String = _
>      "SELECT ""urn:schemas:httpmail:subject"", " & _
>             """urn:schemas:mailheader:date"", " & _
>             """urn:schemas:httpmail:textdescription"" " & _
>      "FROM """ & urlInbox & """ " & _
>      "WHERE ""urn:schemas:httpmail:subject"" = 'MO SMS delivery
> message' " & _
>      "ORDER BY ""urn:schemas:mailheader:date"" DESC"
>    adoRsMsgs.Open(strSQL)
>    Do While Not adoRsMsgs.EOF
>      ... More processing here ...
>    Loop
>
> This code doesn't work on other mailboxes (on which I have user
> permissions and can open both in Outlook and OWA). What am I missing?
>
> TIA
>
date: Mon, 27 Feb 2006 09:51:53 +1100   author:   Glen Scales [MVP]

Re: Query working only on my mailbox   
Hi Glen,

My code throws an exception on the Open() statement, but no details are
given.

I tried the code in the link and got a "The remote server returned an
error: (501) Not Implemented." exception on the GetRequestStream()
statement.
date: 26 Feb 2006 22:30:43 -0800   author:   unknown

Re: Query working only on my mailbox   
Oooops...

I had a problem with my password. After fixing it the sample code at
the link throws a "The remote server returned an error: (401)
Unauthorized." exception when calling Request.GetResponse(). Sorry
about that.
date: 26 Feb 2006 23:00:54 -0800   author:   unknown

Re: Query working only on my mailbox   
Opps 2...

After some more tweaking the code now works for my own mailbox and some
other mailboxes, but NOT on the mailbox I'm. Exception returned: "The
remote server returned an error: (404) Not Found."
date: 26 Feb 2006 23:35:12 -0800   author:   unknown

Re: Query working only on my mailbox   
Problem solved. It took me some time to realize that the Inbox on that
mailbox wasn't called "Inbox" but some other name. I fixed the URL and
my code started working.

Thanks a lot.
date: 27 Feb 2006 00:40:55 -0800   author:   unknown

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us