Restrict Appointments by EntryID not working

M

MB34

(Using Delphi)
Trying to restrict AppointmentItems by EntryID like below:

Folder := Namespace.GetDefaultFolder( olFolderCalendar );
Items := Folder.Items;
AppointmentItems := Items.Restrict('[EntryID] = "' +
qryEvents.fieldByName('OLEntrytID').AsString + '"');

But getting this error:
-2147352567 "Condition is not valid"

I *KNOW* that the VALUE is valid.

Am I doing something incorrectly?
 
M

MB34

(Using Delphi)
Trying to restrict AppointmentItems by EntryID like below:

          Folder    := Namespace.GetDefaultFolder( olFolderCalendar );
          Items     := Folder.Items;
          AppointmentItems := Items.Restrict('[EntryID] = "' +
qryEvents.fieldByName('OLEntrytID').AsString + '"');

But getting this error:
-2147352567 "Condition is not valid"

I *KNOW* that the VALUE is valid.

Am I doing something incorrectly?

According to Sue Mosher:
If you looked up Restrict in Help, you'd quickly learn that EntryID is
one of the fields you can't use. Instead, you should be using the
Namespace.GetItemFromID method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top