dbTalk Databases Forums  

MAPI.Session in ActiveX Script Task

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss MAPI.Session in ActiveX Script Task in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jeff M
 
Posts: n/a

Default MAPI.Session in ActiveX Script Task - 07-22-2004 , 12:08 PM






Can anyone get the following VBScript to work when run in
an ActiveX Script Task in a DTS package?

Function Main()
Dim objSession
Set objSession = CreateObject("MAPI.Session")
Set objSession = Nothing
Main = DTSTaskExecResult_Success
End Function

SQL Server won't create the MAPI.Session object when the
package is executed, instead, I get an ambiguous error. I
can run the ActiveX Script step successfully if I'm in the
DTS designer and right-click over the step and
choose 'Execute Step' from the shortcut menu. I do have
CDO and Outlook installed on the SQL box and am able to
use full blown VB to create and manipulate a MAPI.Session
object on the box.

Any help is greatly appreciated.
Thanks,
Jeff

Reply With Quote
  #2  
Old   
Sue Hoegemeier
 
Posts: n/a

Default Re: MAPI.Session in ActiveX Script Task - 07-27-2004 , 04:05 PM






Works for me.
One thought is to make sure the task is set to execute on
main thread - I've seen problems before when this isn't set.

-Sue

On Thu, 22 Jul 2004 10:08:50 -0700, "Jeff M"
<anonymous (AT) discussions (DOT) microsoft.com> wrote:

Quote:
Can anyone get the following VBScript to work when run in
an ActiveX Script Task in a DTS package?

Function Main()
Dim objSession
Set objSession = CreateObject("MAPI.Session")
Set objSession = Nothing
Main = DTSTaskExecResult_Success
End Function

SQL Server won't create the MAPI.Session object when the
package is executed, instead, I get an ambiguous error. I
can run the ActiveX Script step successfully if I'm in the
DTS designer and right-click over the step and
choose 'Execute Step' from the shortcut menu. I do have
CDO and Outlook installed on the SQL box and am able to
use full blown VB to create and manipulate a MAPI.Session
object on the box.

Any help is greatly appreciated.
Thanks,
Jeff


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.