Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Activex Programming Control Webdc > DTS the global ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 254 of 279
Post > Topic >>

DTS the global variable for ActiveX script

by =?Utf-8?B?V2VuZHk=?= <Wendy@[EMAIL PROTECTED] > Jun 16, 2008 at 12:34 PM

Hi,
I've a 2003 server running MS SQL 2000, I'd like to fire an email to a
list 
of users.

I've been trying to use a scheduled DTS package to do this.

I've set up a microsoft OLE DB connection to the database, followed by an 
Execute SQL Task, then an ActiveX script task.

I've set the output in the sql task to pull the variables(UserEmaillist)
out 
of it and it says it runs ok.  But it can’t pass the global variable 
UserEmaillist into  “iMsg.To = "&'strUserEmaillist'&;"”
The following is the ActiveX script, any ideas?
'**********************************************************************
'  Visual Basic ActiveX Script
'************************************************************************

Function Main()
dim strUserEmaillist
dim crlf
crlf = chr(13)&chr(10)
Set iMsg = createobject("CDO.Message")
strUserEmaillist =  DTSGlobalVariables("UserEmaillist").Value
strFilename = "D:\Extracts\SourceCode\ExtensionRe****t.txt"
'**************************************************************
'Do not change this part

iMsg.Configuration.fields("http://schemas.microsoft.com/cdo/configuration/smtpserver").value
= "139.68.133.51"
iMsg.Configuration.fields("http://schemas.microsoft.com/cdo/configuration/sendusing").value
= 2
iMsg.Configuration.fields("http://schemas.microsoft.com/cdo/configuration/smtpserver****t").value
= 25
iMsg.Configuration.fields.update
iMsg.MimeFormatted          = False
iMsg.AutoGenerateTextBody   = False

'Do not change this part
'**************************************************************
dim strFileName
'List the email addresses separated by commas
iMsg.To                     = "&'strUserEmaillist'&;"

iMsg.from                   = "wendy@[EMAIL PROTECTED]
"

iMsg.Subject                = "Extensions going live" 
iMsg.TextBody               = "This is an automated email to notify you
that 
these extensions are going live on the date which is showing in the
attached 
file." &crlf & "Please contact Wendy( wendy@[EMAIL PROTECTED]
 ) for any" & crlf & 
"issues."

'Duplicate this line for as many attachments as necessary
iMsg.AddAttachment(strFilename)


iMsg.Send
Main = DTSTaskExecResult_Success
End Function 
 ------------------

Thanks,

Wendy
 




 1 Posts in Topic:
DTS the global variable for ActiveX script
=?Utf-8?B?V2VuZHk=?= <  2008-06-16 12:34:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 19:33:09 CST 2008.