Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
julesr
Starting Member
14 Posts |
Posted - 2003-11-14 : 05:57:43
|
| I've created a DTS package. It contains a series of ActiveX Script Tasks. All the VB script executes OK apart from the script below. I just can't figure out what's the problem is. The error message is "ActiveX scripting encountered a runtime error during the execution of the script". The same script runs fine from an ASP page. I'd appreciate any pointers. Thanks.------------------------------------Function Main()Call SendCDOMail()Main = DTSTaskExecResult_SuccessEnd FunctionFunction SendCDOMail()'On Error Resume Next Dim iMsg, Flds, iConf Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") Set Flds = iConf.Fields Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" Flds.Update Set iMsg.Configuration = iConf iMsg.To = "jules@charon.co.uk" iMsg.From = "jules@charon.co.uk" iMsg.Subject = "subj" iMsg.TextBody = "some text" iMsg.SendEnd Function---------------------------------------------Juleshttp://www.charon.co.uk |
|
|
julesr
Starting Member
14 Posts |
Posted - 2003-11-14 : 06:18:54
|
| Well, this is typical. I spend hours last night to try and solve this to no avail. Then, after posting, I solve it a minutes later. The solution is to use this. Not sure why the Configuration object is being baulked at.Function Main()Call SendCDOMail()Main = DTSTaskExecResult_SuccessEnd FunctionFunction SendCDOMail() Dim iMsg Set iMsg = CreateObject("CDO.Message") iMsg.To = "jules@charon.co.uk" iMsg.From = "jules@charon.co.uk" iMsg.Subject = "subj" iMsg.TextBody = "some text" iMsg.Send Set iMsg = NothingEnd FunctionJuleshttp://www.charon.co.uk |
 |
|
|
Stoad
Freaky Yak Linguist
1983 Posts |
Posted - 2003-11-14 : 06:48:52
|
quote: Then, after posting, I solve it a minutes later.
Yes!! It's just an incredible Law of (Human) Nature.BTW the same case with posted answers :) |
 |
|
|
|
|
|