SQL filters with MAPITABLE

D

DENNIS BROWN

I'm using Redemption to create a session, then I get the current folder, then I create a oCurrentItem by mapping it to my oCurrentFolder.Items.
I can get oCurrentItem.Count to return 27, the number of items in that folder, but what I want to do is use SQL to find all the items that have the AllDayEvent flag set, and, in another area of my code, find all the appointments that have a Start > Some_Date AND Start < Some_Other_Date.

I declare a oRecordSet object, then map it to the
oCurrentItem.MAPITABLE.ExecSQL("Select Subject From !Don't_Know_What_Goes_Here! Where AllDayEvent < 1)
1. What goes in the "From" part of the string, and
2. Is the AllDayEvent < 1 correct?
 
D

Dmitry Streblechenko

1. The "from" clause is ignored, but it needs to be there (just to make a SQL query). "Select whatever from Folder" should work.
2. Use AllDayEvent = 'true'

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
I'm using Redemption to create a session, then I get the current folder, then I create a oCurrentItem by mapping it to my oCurrentFolder.Items.
I can get oCurrentItem.Count to return 27, the number of items in that folder, but what I want to do is use SQL to find all the items that have the AllDayEvent flag set, and, in another area of my code, find all the appointments that have a Start > Some_Date AND Start < Some_Other_Date.

I declare a oRecordSet object, then map it to the
oCurrentItem.MAPITABLE.ExecSQL("Select Subject From !Don't_Know_What_Goes_Here! Where AllDayEvent < 1)
1. What goes in the "From" part of the string, and
2. Is the AllDayEvent < 1 correct?
 

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