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)