Home All Groups Group Topic Archive Search About

Redemption MAPITable Question

Author
16 Nov 2007 5:38 PM
Patrick Pirtle
Well, this seems like it should be simple.  So, I assume I'm
overlooking something small.

Here's my code:


Public Sub TestMapiTable()
    Dim oRecordset As Object
    Dim oTable As Object

    Set oTable = CreateObject("Redemption.MAPITable")
    oTable.item = Outlook.Session.GetDefaultFolder(olFolderContacts).Items

    Set oRecordset = oTable.ExecSQL("SELECT * from Folder")
    While Not oRecordset.EOF
        Debug.Print (oRecordset.Fields("Email1DisplayName").Value)
        oRecordset.MoveNext
    Wend
End Sub


The line beginning "Set oRecordset = oTable.ExecSQL"
gives me an error "Object doesn't support this property
or method."  TIA for any help as to what I'm missing.



____________________________________________
The impossible just takes a little longer...

Author
16 Nov 2007 7:00 PM
Ken Slovak - [MVP - Outlook]
Your code works here.

Are you using a version of Redemption that supports ExecSQL? Check your
version and check the Object Browser to see if your version of Redemption
supports that method.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


Show quote
"Patrick Pirtle" <pap at mka dot com> wrote in message
news:u98AQeHKIHA.2268@TK2MSFTNGP02.phx.gbl...
> Well, this seems like it should be simple.  So, I assume I'm
> overlooking something small.
>
> Here's my code:
>
>
> Public Sub TestMapiTable()
>    Dim oRecordset As Object
>    Dim oTable As Object
>
>    Set oTable = CreateObject("Redemption.MAPITable")
>    oTable.item = Outlook.Session.GetDefaultFolder(olFolderContacts).Items
>
>    Set oRecordset = oTable.ExecSQL("SELECT * from Folder")
>    While Not oRecordset.EOF
>        Debug.Print (oRecordset.Fields("Email1DisplayName").Value)
>        oRecordset.MoveNext
>    Wend
> End Sub
>
>
> The line beginning "Set oRecordset = oTable.ExecSQL"
> gives me an error "Object doesn't support this property
> or method."  TIA for any help as to what I'm missing.
>
>
>
> ____________________________________________
> The impossible just takes a little longer...
>
Author
16 Nov 2007 8:41 PM
Dmitry Streblechenko
Also note that if you use "select *", Redemption will decide what names the
columns will have, and those will DASL names.
If you need Email1DisplayName, explicitly request it; there is no reason to
use * besides slowing down your network :-)

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

Show quote
"Ken Slovak - [MVP - Outlook]" <kenslo***@mvps.org> wrote in message
news:ebecMMIKIHA.3940@TK2MSFTNGP05.phx.gbl...
> Your code works here.
>
> Are you using a version of Redemption that supports ExecSQL? Check your
> version and check the Object Browser to see if your version of Redemption
> supports that method.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "Patrick Pirtle" <pap at mka dot com> wrote in message
> news:u98AQeHKIHA.2268@TK2MSFTNGP02.phx.gbl...
>> Well, this seems like it should be simple.  So, I assume I'm
>> overlooking something small.
>>
>> Here's my code:
>>
>>
>> Public Sub TestMapiTable()
>>    Dim oRecordset As Object
>>    Dim oTable As Object
>>
>>    Set oTable = CreateObject("Redemption.MAPITable")
>>    oTable.item = Outlook.Session.GetDefaultFolder(olFolderContacts).Items
>>
>>    Set oRecordset = oTable.ExecSQL("SELECT * from Folder")
>>    While Not oRecordset.EOF
>>        Debug.Print (oRecordset.Fields("Email1DisplayName").Value)
>>        oRecordset.MoveNext
>>    Wend
>> End Sub
>>
>>
>> The line beginning "Set oRecordset = oTable.ExecSQL"
>> gives me an error "Object doesn't support this property
>> or method."  TIA for any help as to what I'm missing.
>>
>>
>>
>> ____________________________________________
>> The impossible just takes a little longer...
>>
>
Author
16 Nov 2007 9:49 PM
Patrick Pirtle
Thanks for the reply, Dmitry.  I simply must be overlooking
something.  I re-downloaded the developer version, uninstalled,
and reinstalled, but can't get it to work.  Any idea what I'm
missing?  Thanks, again, for your help.

____________________________________________
The impossible just takes a little longer...


Dmitry Streblechenko wrote:
Show quote
> Also note that if you use "select *", Redemption will decide what
> names the columns will have, and those will DASL names.
> If you need Email1DisplayName, explicitly request it; there is no
> reason to use * besides slowing down your network :-)
>
Author
17 Nov 2007 5:38 PM
Ken Slovak - [MVP - Outlook]
Try removing the reference to Redemption as Dmitry indicated, in VB and/or
VBA and then OK the change then add it back again. See what happens.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


Show quote
"Patrick Pirtle" <pap at mka dot com> wrote in message
news:%23yz6GqJKIHA.4712@TK2MSFTNGP04.phx.gbl...
> Thanks for the reply, Dmitry.  I simply must be overlooking
> something.  I re-downloaded the developer version, uninstalled,
> and reinstalled, but can't get it to work.  Any idea what I'm
> missing?  Thanks, again, for your help.
>
> ____________________________________________
> The impossible just takes a little longer...
Author
16 Nov 2007 9:46 PM
Patrick Pirtle
Hmmm...Well, I'm using V4.4.0.714, and have purchased
the redistributable version.  Just to be sure, I uninstalled it,
downloaded the developer version from Dmitry's site, and
reinstalled it.

The MAPITable doesn't seem to have the ExecSQL
method.  Any idea where I'm going wrong?  Thanks.

____________________________________________
The impossible just takes a little longer...Hmmm...


Ken Slovak - [MVP - Outlook] wrote:
Show quote
> Your code works here.
>
> Are you using a version of Redemption that supports ExecSQL? Check
> your version and check the Object Browser to see if your version of
> Redemption supports that method.
[snip]
Author
17 Nov 2007 7:22 AM
Dmitry Streblechenko
Did you remove Redemption from your project references and re-add it again
to make sure VB can see the latest version?
Can you try to run the following script from OutlookSpy (click "Script
Editor", paste the script, click Run)?

set Table = CreateObject("Redemption.MAPITable")
Table.Item =Application.ActiveExplorer.CurrentFolder.Items
Set Recordset = Table.ExecSQL("SELECT Subject, ReceivedTime, EntryID from
Folder " & _
                                               "order by ReceivedTime desc")
while not Recordset.EOF
  Debug.Print(Recordset.Fields("ReceivedTime").Value & " - " &
Recordset.Fields("Subject").Value)
  Recordset.MoveNext
wend


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

Show quote
"Patrick Pirtle" <pap at mka dot com> wrote in message
news:ODdgpoJKIHA.6008@TK2MSFTNGP05.phx.gbl...
> Hmmm...Well, I'm using V4.4.0.714, and have purchased
> the redistributable version.  Just to be sure, I uninstalled it,
> downloaded the developer version from Dmitry's site, and
> reinstalled it.
>
> The MAPITable doesn't seem to have the ExecSQL
> method.  Any idea where I'm going wrong?  Thanks.
>
> ____________________________________________
> The impossible just takes a little longer...Hmmm...
>
>
> Ken Slovak - [MVP - Outlook] wrote:
>> Your code works here.
>>
>> Are you using a version of Redemption that supports ExecSQL? Check
>> your version and check the Object Browser to see if your version of
>> Redemption supports that method.
> [snip]
>
>
Author
19 Nov 2007 8:49 PM
Patrick Pirtle
Dmitry -
As always, many thanks for your help.  The problem turned
out to be that, although I had installed the latest DLL into
"C:\program files\redemption", the version that was *really*
getting used was in "C:\Windows\System32".  Although I
tried unregistering the one in the System32 folder, followed
by registering the one in "Program Files", I couldn't get it to
work.  Ultimately, I just copied the new one over into the
System32 folder and re-registered it.

The code below worked just fine in OutlookSpy.  Now,
it's back to working on my little app.  Thanks, again, to
both yourself and Ken Slovak.
- Patrick
____________________________________________
The impossible just takes a little longer...


Dmitry Streblechenko wrote:
Show quote
> Did you remove Redemption from your project references and re-add it
> again to make sure VB can see the latest version?
> Can you try to run the following script from OutlookSpy (click "Script
> Editor", paste the script, click Run)?
>
> set Table = CreateObject("Redemption.MAPITable")
> Table.Item =Application.ActiveExplorer.CurrentFolder.Items
> Set Recordset = Table.ExecSQL("SELECT Subject, ReceivedTime, EntryID
> from Folder " & _
>                                               "order by ReceivedTime
> desc") while not Recordset.EOF
>  Debug.Print(Recordset.Fields("ReceivedTime").Value & " - " &
> Recordset.Fields("Subject").Value)
>  Recordset.MoveNext
> wend
>
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool
>
> "Patrick Pirtle" <pap at mka dot com> wrote in message
> news:ODdgpoJKIHA.6008@TK2MSFTNGP05.phx.gbl...
>> Hmmm...Well, I'm using V4.4.0.714, and have purchased
>> the redistributable version.  Just to be sure, I uninstalled it,
>> downloaded the developer version from Dmitry's site, and
>> reinstalled it.
>>
>> The MAPITable doesn't seem to have the ExecSQL
>> method.  Any idea where I'm going wrong?  Thanks.
>>
>> ____________________________________________
>> The impossible just takes a little longer...Hmmm...
>>
>>
>> Ken Slovak - [MVP - Outlook] wrote:
>>> Your code works here.
>>>
>>> Are you using a version of Redemption that supports ExecSQL? Check
>>> your version and check the Object Browser to see if your version of
>>> Redemption supports that method.
>> [snip]

--
Author
20 Nov 2007 4:45 AM
Dmitry Streblechenko
Since System32 is in the PATH,
regsvr32.exe redemption.dll
will register the dll in System32. Specify fully qualified path when
registering with regsvr32.exe:
regsvr32.exe "c:\program files\redemption\redemption.dll"

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

Show quote
"Patrick Pirtle" <pap at mka dot com> wrote in message
news:%23FOqg2uKIHA.4272@TK2MSFTNGP06.phx.gbl...
> Dmitry -
> As always, many thanks for your help.  The problem turned
> out to be that, although I had installed the latest DLL into
> "C:\program files\redemption", the version that was *really*
> getting used was in "C:\Windows\System32".  Although I
> tried unregistering the one in the System32 folder, followed
> by registering the one in "Program Files", I couldn't get it to
> work.  Ultimately, I just copied the new one over into the
> System32 folder and re-registered it.
>
> The code below worked just fine in OutlookSpy.  Now,
> it's back to working on my little app.  Thanks, again, to
> both yourself and Ken Slovak.
> - Patrick
> ____________________________________________
> The impossible just takes a little longer...
>
>
> Dmitry Streblechenko wrote:
>> Did you remove Redemption from your project references and re-add it
>> again to make sure VB can see the latest version?
>> Can you try to run the following script from OutlookSpy (click "Script
>> Editor", paste the script, click Run)?
>>
>> set Table = CreateObject("Redemption.MAPITable")
>> Table.Item =Application.ActiveExplorer.CurrentFolder.Items
>> Set Recordset = Table.ExecSQL("SELECT Subject, ReceivedTime, EntryID
>> from Folder " & _
>>                                               "order by ReceivedTime
>> desc") while not Recordset.EOF
>>  Debug.Print(Recordset.Fields("ReceivedTime").Value & " - " &
>> Recordset.Fields("Subject").Value)
>>  Recordset.MoveNext
>> wend
>>
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy  - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "Patrick Pirtle" <pap at mka dot com> wrote in message
>> news:ODdgpoJKIHA.6008@TK2MSFTNGP05.phx.gbl...
>>> Hmmm...Well, I'm using V4.4.0.714, and have purchased
>>> the redistributable version.  Just to be sure, I uninstalled it,
>>> downloaded the developer version from Dmitry's site, and
>>> reinstalled it.
>>>
>>> The MAPITable doesn't seem to have the ExecSQL
>>> method.  Any idea where I'm going wrong?  Thanks.
>>>
>>> ____________________________________________
>>> The impossible just takes a little longer...Hmmm...
>>>
>>>
>>> Ken Slovak - [MVP - Outlook] wrote:
>>>> Your code works here.
>>>>
>>>> Are you using a version of Redemption that supports ExecSQL? Check
>>>> your version and check the Object Browser to see if your version of
>>>> Redemption supports that method.
>>> [snip]
>
> --
>
>

AddThis Social Bookmark Button