Re: Filter address book on PR_EMS_AB_HOME_MDB
From: Mikael Svenson (mikaels_at_powertech.no)
Date: 02/24/05
- Next message: Dmitry Streblechenko: "Re: Writing into PST"
- Previous message: Jeff McKay: "Unable to open message store"
- In reply to: Mikael Svenson: "Re: Filter address book on PR_EMS_AB_HOME_MDB"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 24 Feb 2005 09:33:54 +0100
Just wanted to tell you all that it worked perfectly by just getting one
row at a time from the addressbook, and doing a seek past the one which
caused the MAPI_E_NOT_ENOUGH_RESOURCES error :)
-m
Mikael Svenson wrote:
>
> All rows in a single call. I ask for 5 properties and get 50 rows each
> time with those 5 properties (250/5). Then I have a loop where I ask
> until there's no more returned. But it fails after around 800 of 1200
> entries. I have yet to try one at a time live on their system.
>
> Guess I'll have to bring my laptop to the customer and do some live
> testing.
>
> I'm trying to get as many possible solutions available before I test
> them out at the customers, and hopefully one of them will work. The
> filter one will not work apparently since the restictions don't work as
> planned :)
>
> My two other options so far seems to be one entry at a time with SeekRow
> to skip, or just asking for one property (the entryid) and hope that
> don't fail, and load up the other fields one entry at a time. Hopefully
> one of these will let me get around the error in their address list.
>
> -m
>
> Dmitry Streblechenko wrote:
> >
> > Do you get the error when you request all rows in a single call or when you
> > you do that one row at a time?
> >
> > Dmitry Streblechenko (MVP)
> > http://www.dimastr.com/
> > OutlookSpy - Outlook, CDO
> > and MAPI Developer Tool
> >
> > "Mikael Svenson" <mikaels@powertech.no> wrote in message
> > news:42188BC1.71B6D9DE@powertech.no...
> > > Yes. I suspect the address entry which causes this is outside the
> > > mailserver I'm working with, that's why I tried to apply the filter to
> > > avoid retrieving the entry. Since it's at a customers it's hard to get
> > > them to locate the error as well.
> > >
> > > Do you think my theory about not having a filter, and then getting one
> > > and one entry from the GAL, and then using SeekRow to skip it would
> > > work? Either way I guess I have to try it. Another way around it might
> > > be to only list the PR_ACCOUNT (assuming this wouldn't cause the
> > > resource error), and then retreive the other properties afterwards,
> > > catching the error there instead.
> > >
> > > If I knew all the MAPI quirks before I started....hehehe.. but it's
> > > kinda fun as well :)
> > >
> > > -m
> > >
> > > Dmitry Streblechenko wrote:
> > >>
> > >> Do you mean you get this error when you read the table rows *without* a
> > >> restiction?
> > >>
> > >> Dmitry Streblechenko (MVP)
> > >> http://www.dimastr.com/
> > >> OutlookSpy - Outlook, CDO
> > >> and MAPI Developer Tool
> > >>
> > >> "Mikael Svenson" <mikaels@powertech.no> wrote in message
> > >> news:42173012.BE0E4D01@powertech.no...
> > >> > That's what I'm doing as well, except I get this stupid
> > >> > MAPI_E_NOT_ENOUGH_RESOURCES error which stops the looping of the
> > >> > mailboxes.
> > >> >
> > >> > -m
> > >> >
> > >> > Dmitry Streblechenko wrote:
> > >> >>
> > >> >> 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: Dmitry Streblechenko: "Re: Writing into PST"
- Previous message: Jeff McKay: "Unable to open message store"
- In reply to: Mikael Svenson: "Re: Filter address book on PR_EMS_AB_HOME_MDB"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|