Re: Filter address book on PR_EMS_AB_HOME_MDB
From: Dmitry Streblechenko (dmitry_at_dimastr.com)
Date: 02/18/05
- Next message: allan.young_at_gmail.com: "Re: Accessing Outlook contacts -- confusion about"
- Previous message: Dmitry Streblechenko: "Re: Accessing Outlook contacts -- confusion about"
- In reply to: Mikael Svenson: "Re: Filter address book on PR_EMS_AB_HOME_MDB"
- Next in thread: Mikael Svenson: "Re: Filter address book on PR_EMS_AB_HOME_MDB"
- Reply: Mikael Svenson: "Re: Filter address book on PR_EMS_AB_HOME_MDB"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 18 Feb 2005 11:59:15 -0700
Looking at my source code that deals with filtering out mailboxes based on
the server, I too don't use a restriction - I vaguely remember that it
didn't work for me either, so I just loaded all rows and did the filtering
in my code...
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Mikael Svenson" <mikaels@powertech.no> wrote in message
news:4215AA2B.BC22E53B@powertech.no...
> The errorcode I get is -2147221225 which is MAPI_E_TOO_COMPLEX.
>
> -m
>
> Mikael Svenson wrote:
>>
>> No such luck. Any call I try with FindRow just fails. Even the ones
>> which work with table.Restrict. And that's using the exact same
>> restrict.
>>
>> MAPI33.MapiRestrictions.Restriction restriction =
>> new MAPI33.MapiRestrictions.Compare( Tags.PR_ACCOUNT,
>> MAPI33.MapiRestrictions.Compare.TYPES.Equal,
>> new MAPI33.MapiTypes.MapiString( Tags.PR_ACCOUNT,
>> "Administrator" ) );
>>
>> //This works:
>>
>> table.Restrict( restriction, IMAPITable.FLAGS.Default );
>>
>> //This won't work:
>>
>> table.FindRow( restriction, (uint)IMAPITable.FLAGS.BookmarkBeginning, 0
>> );
>>
>> The reason why I'm trying to restrict entries to one mailserver is that
>> some entry is giving me an MAPI_E_NOT_ENOUGH_RESOURCES, and I suspect
>> it's an entry from another mail server. By putting on a restriction I
>> figured I could circumvent the erroneus entry.
>>
>> Would it work by using QueryRows one row at a time, and if I get the
>> resource error then do a table.SeekRow(
>> (uint)IMAPITable.FLAGS.BookmarkCurrent, 1, ref rowSought ) to skip the
>> entry and continue?
>>
>> The error happens at a customers so I can't test it before next week.
>>
>> -m
>>
>> Dmitry Streblechenko wrote:
>> >
>> > Try to use FindRow instead of Restrict - I have seen cases where
>> > Restrict
>> > was failing but FindRow was working just fine.
>> >
>> > Dmitry Streblechenko (MVP)
>> > http://www.dimastr.com/
>> > OutlookSpy - Outlook, CDO
>> > and MAPI Developer Tool
>> >
>> > "Mikael Svenson" <mikaels@powertech.no> wrote in message
>> > news:42145FF1.1064B9EF@powertech.no...
>> > > MAPI33.MapiRestrictions.Restriction restriction =
>> > > new MAPI33.MapiRestrictions.Compare( Tags.PR_EMS_AB_HOME_MDB,
>> > > MAPI33.MapiRestrictions.Compare.TYPES.Equal,
>> > > new MAPI33.MapiTypes.MapiString( Tags.PR_EMS_AB_HOME_MDB,
>> > > "/o=Domain/ou=Location/cn=Configuration/cn=Servers/cn=MAIL/cn=Microsoft
>> > > Private MDB" ) );
>> > >
>> > > err = table.Restrict( restriction, IMAPITable.FLAGS.Default );
>> > >
>> > > So I think it's a COMPAREPROPS. I have tried with Content as well,
>> > > but I
>> > > get an error using that as restriction.
>> > >
>> > >
>> > > MAPI33.MapiRestrictions.Restriction restriction =
>> > > new MAPI33.MapiRestrictions.Content(
>> > > MAPI33.MapiRestrictions.Content.TYPES.IgnoreCase,
>> > > Tags.PR_EMS_AB_HOME_MDB,
>> > > new MAPI33.MapiTypes.MapiString( Tags.PR_EMS_AB_HOME_MDB,
>> > > "/o=Domain/ou=Location/cn=Configuration/cn=Servers/cn=MAIL/cn=Microsoft
>> > > Private MDB" ) );
>> > >
>> > >
>> > > I'm guessing RES_COMPAREPROPS is correct, but that Exchange 5.5 fails
>> > > somehow. I have spoken a bit with the author of MAPI33 as well, and
>> > > he
>> > > agrees that it's weird behaviour.
>> > >
>> > > I will try the same code tomorrow with Redemption and see if the
>> > > result
>> > > is the same.
>> > >
>> > > -m
>> > >
>> > >
>> > > Dmitry Streblechenko wrote:
>> > >>
>> > >> "Compare" as in RES_COMPAREPROPS? Did you try to use RES_CONTENT?
>> > >> Please do post the relevant portions of your code.
>> > >>
>> > >> Dmitry Streblechenko (MVP)
>> > >> http://www.dimastr.com/
>> > >> OutlookSpy - Outlook, CDO
>> > >> and MAPI Developer Tool
>> > >>
>> > >> "Mikael Svenson" <mikaels@powertech.no> wrote in message
>> > >> news:42130699.C8275BA1@powertech.no...
>> > >> > I'm using MAPI33 on this, but it's a compare restriction where I
>> > >> > use
>> > >> > PR_EMS_AB_HOME_MDB and a string to compare with.
>> > >> >
>> > >> > And the DN is shorter than 255 characters as well. I use 0 for the
>> > >> > flag
>> > >> > when setting the restriction on the table.
>> > >> >
>> > >> > If I try a compare on PR_EMAIL_ADDRESS it works just fine. And
>> > >> > equal/notequal are also exclusive.
>> > >> >
>> > >> > -m
>> > >> >
>> > >> > Dmitry Streblechenko wrote:
>> > >> >>
>> > >> >> Whay is the restriction kind and flags?
>> > >> >>
>> > >> >> Dmitry Streblechenko (MVP)
>> > >> >> http://www.dimastr.com/
>> > >> >> OutlookSpy - Outlook, CDO
>> > >> >> and MAPI Developer Tool
>> > >> >>
>> > >> >> "Mikael Svenson" <mikaels@powertech.no> wrote in message
>> > >> >> news:4211FF68.3A458A14@powertech.no...
>> > >> >> > I'm trying to write a restriction on PR_EMS_AB_HOME_MDB when I
>> > >> >> > retrieve
>> > >> >> > the GAL. I want to get all the mailbox's from a particular
>> > >> >> > server.
>> > >> >> >
>> > >> >> > I've tried to add
>> > >> >> > "/o=Domain/ou=Location/cn=Configuration/cn=Servers/cn=MAIL/cn=Microsoft
>> > >> >> > Private MDB"
>> > >> >> >
>> > >> >> > as the filter, but I get 0 entries back. Same with NotEqual on
>> > >> >> > the
>> > >> >> > same
>> > >> >> > filter.
>> > >> >> >
>> > >> >> > If I write "lalala" as the filter I get all entries with both
>> > >> >> > equal
>> > >> >> > and
>> > >> >> > not equal. Guess something is wrong somewhere :)
>> > >> >> >
>> > >> >> > -m
- Next message: allan.young_at_gmail.com: "Re: Accessing Outlook contacts -- confusion about"
- Previous message: Dmitry Streblechenko: "Re: Accessing Outlook contacts -- confusion about"
- In reply to: Mikael Svenson: "Re: Filter address book on PR_EMS_AB_HOME_MDB"
- Next in thread: Mikael Svenson: "Re: Filter address book on PR_EMS_AB_HOME_MDB"
- Reply: Mikael Svenson: "Re: Filter address book on PR_EMS_AB_HOME_MDB"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|