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.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 ActiveX Scripting encountered a Run Time Error dur

Author  Topic 

sonu
Posting Yak Master

110 Posts

Posted - 2011-11-29 : 13:22:24
Hi,

I am using an ActiveX script task in my dts package and this has worked for years. However since a week I get the following message just when the send function is called:

ERROR: ActiveX Scripting encountered a Run Time Error during the execution of the script.


Function Main()
SendEmail()
Main = DTSTaskExecResult_Success
End Function

Function SendEmail()
Dim dt
dt = Date
dim CurrentDate
CurrentDate = Month(dt) & "/" & Day( dt ) & "/" & Year(dt)

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = CurrentDate
objMessage.From = "xx@xx.net"
objMessage.To = "xx@xx.net"
objMessage.HTMLBody = CurrentDate

'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "xx.xx.net"

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xx"

'Your password on the SMTP server
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xx"

'Server port (typically 25)
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objMessage.Configuration.Fields.Update

objMessage.Send
End Function
   

- Advertisement -