Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Exchange Server / Applications / April 2006

Tip: Looking for answers? Try searching our database.

Select messages from a large public folder

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Yahya - 21 Apr 2006 10:26 GMT
Dear Sirs,

I am trying to exectue the below attached code to select the messages from a
public folder that contains 160,000 messages and receiving 400 as my status,
could it be because the public folder contains a large number of records?
How can I limit my select to the top 1000 messages?

Thanks,
Yahya
Dim oXMLHttp As MSXML2.XMLHTTP30 = New MSXML2.XMLHTTP30

Dim sQuery As String

' Open the folder.

oXMLHttp.open("SEARCH", sUrlFrom, False, strDomain & "\" & strUserName,
strPassword)

'

' Set up the query.

sQuery = "<?xml version='1.0'?>" & _

"<g:searchrequest xmlns:g='DAV:'>" & _

"<g:sql>SELECT ""DAV:displayname"", ""urn:schemas:mailheader:message-id"",
""urn:schemas:httpmail:subject"", ""urn:schemas:httpmail:from"",
""urn:schemas:httpmail:to"", ""urn:schemas:httpmail:cc"",
""urn:schemas:httpmail:textdescription"" " & _

"FROM SCOPE('SHALLOW TRAVERSAL OF """ & sUrlFrom & """')"

sQuery = sQuery & " WHERE ""DAV:isfolder"" = false" & _

"</g:sql>" & _

"</g:searchrequest>"

' Set up request headers.

oXMLHttp.setRequestHeader("Content-Type", "text/xml")

oXMLHttp.setRequestHeader("Translate", "f")

oXMLHttp.setRequestHeader("Depth", "0")

oXMLHttp.setRequestHeader("Content-Length", "" & sQuery.Length)

' Send the query.

oXMLHttp.send(sQuery)
Henning Krause [MVP] - 21 Apr 2006 10:42 GMT
Hello,

use the Range-Header:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_exch
2k_sql_range_header.asp


Greetings,
Henning Krause

> Dear Sirs,
>
[quoted text clipped - 50 lines]
>
> oXMLHttp.send(sQuery)
Yahya - 21 Apr 2006 11:48 GMT
Thanks Henning

> Hello,
>
> use the Range-Header:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_exch
2k_sql_range_header.asp


> Greetings,
> Henning Krause
[quoted text clipped - 53 lines]
> >
> > oXMLHttp.send(sQuery)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.