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)
 having trouble with this ActiveX script

Author  Topic 

ws5926
Yak Posting Veteran

88 Posts

Posted - 2007-03-19 : 15:52:52
I am having trouble getting this script working in my ActiveX task:


Dim iConf As New CDO.Configuration
Dim Flds As ADODB.Fields
Set Flds = iConf.Fields
Flds(cdoLanguageCode) = "en-us"
Flds(CDO.cdoTimeZoneIDURN) = cdoMountain
Flds.Update
Dim iMsg As New CDO.Message
Set iMsg.Configuration = iConf



What I am trying to do is set the time zone for the message. All of the messages that my server generates through CDO are an hour off. Here is what I have so far, but it generates an error on the 2nd and 3rd Set Flds. commands.




Dim iConf
Set iConf = CreateObject("CDO.Configuration")
Dim Flds
Set Flds = iConf.Fields
Set Flds.cdoLanguageCode = "en-us"
Set Flds.cdoTimeZoneIDURN = 11
' 11 is value for Central time
Flds.Update

Dim objMail
Set objMail = CreateObject("CDO.Message")
Set objMail.Configuration = iConf

objMail.From = " email address goes here"
objMail.To = "my email address goes here"
objMail.Subject="Email from Server"
objMail.TextBody = "This was sent from a DTS job on Server"
objMail.Send
Set objMail = nothing

Main = DTSTaskExecResult_Success
End Function

The error that I am getting is:
Object doesn't suppport this property or method:'cdoLanguageCode'

Thanks in advance for any responses to this post.



Live to Throw
Throw to Live
   

- Advertisement -