Re: Problem when Looping through large number on MS Exchange contacts
- From: "Ken Slovak - [MVP - Outlook]" <kenslovak@xxxxxxxx>
- Date: Wed, 15 Jun 2005 10:00:13 -0400
There is a limit of about 255 RPC channels, which in practice works out usually to around 249 or 250, that you are most likely running into. The problem mostly manifests itself when using the COM Interop and one of the ..NET languages. If that's the case for you the only thing you can do is set the objects to Nothing within your loop and if that doesn't work you'd have to release them using Marshall.ReleaseCOMObject and maybe also explicitly call the garbage collector in your loop, maybe at a 245 items count or something like that.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm
"Carlos Lozano" <CarlosLozano@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:1E58CE93-4173-4095-9E1B-378B4F453B8C@xxxxxxxxxxxxxxxx
Hi,
My application loops through contact items located in a public folder.
Everything works fine until the selection brings a large number of contacts
(> 500).
The process stops with a "type mistmatch" error when the processed item
count reaches 250.
I have something like this:
dim oResults as Outlook.Results dim oContact as Outlook.ContactItem dim oObj as object dim i as int32
' folder AdvancedSearch, retrieving contact items in a oSearch object, ' then assigning the result to the oResults object
for each oObj in oResults
i = i + 1
if oObj.MessageClass = "IPM.Contact" then ' To exclude distribution lists
set oContact = oObj
' Additional code goes here
end if
next
The error happens not always on same contact, but always near item 250 (What
a coincidence!!!)
If I break the the process adding the following inside the loop: if i = 248 then debug.assert(1 = 0) 'Breaks here end if
A lot of traffic happens between the client machine (Outlook) and the server
MS SBS2003 machine, after that I am able to resume the process, but will
eventually crash again if the processing a large enough to count another 250
iterations.
I will appreciate any help.
Carlos Lozano
CAX IT Services
www.caxonline.net
.
- Follow-Ups:
- Re: Problem when Looping through large number on MS Exchange conta
- From: Carlos Lozano
- Re: Problem when Looping through large number on MS Exchange conta
- References:
- Problem when Looping through large number on MS Exchange contacts
- From: Carlos Lozano
- Problem when Looping through large number on MS Exchange contacts
- Prev by Date: Re: Need help with IOlkAccount
- Next by Date: Re: Problem when Looping through large number on MS Exchange conta
- Previous by thread: Problem when Looping through large number on MS Exchange contacts
- Next by thread: Re: Problem when Looping through large number on MS Exchange conta
- Index(es):
Relevant Pages
|