Advertisement

11.14.2007 at 07:41AM PST, ID: 22960190
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

ActiveX script in DTS package

Asked by krbnldy in ActiveX, MS SQL DTS

Tags: , , ,

I am using activeX script in a DTS package to send mail to serveral users if thier ID is found in a particular MSSQL view.  The code is added below.  it is only sending one email for the first employee it finds in the view.  Please help me modify the code so that it could send an email for each employee it finds and add the id of each COntent_ID it finds for each employee.
For testing I am only including my email address and not yet getting the email address from the view.  I will modify that latr

Sub Send_Mail(strTo, strFrom, strSubject, strMessage )
      Const cdoSendUsingPickup = 1
      Const cdoSendUsingPort = 2

      set iMsg = CreateObject("CDO.Message")
      set iConf = CreateObject("CDO.Configuration")
      Set Flds = iConf.Fields
      With Flds
                .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =2 'cdoSendUsingPort
'this parameter below is the valid SMPT Server Name
                .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="******.***.com"
                .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10  
                .Update
      End With

      With iMsg
             Set .Configuration = iConf
            .To = strTo  ' comma separated list of recipients.
            .From = strFrom
            .Subject = strSubject
            .HTMLBody = strMessage
            .Send
      End With

End Sub

Function Main()

dim myConn
dim myRecordset
dim iRowCount
dim rsUnread

' instantiate the ADO objects
      set myConn = CreateObject("ADODB.Connection")
      set myRecordset = CreateObject("ADODB.Recordset")
      
      set rsUnread = CreateObject("ADODB.Recordset")

' set the connection properties to point to the CMS  database  using the ProcessDisplay view

      myConn.Open = "Provider=SQLOLEDB.1;Data Source=******;  Initial Catalog=*******;user id = '********';password='*****'"

' check for unread documents for each emloyee
      mySQLUnread = "Select Emp_ID  from vProcessDisplay"
      rsUnread.Open mySQLUnread, myConn
            
      For xcnt = 0 to rsUnread.fields.count -1
            
            mySQLCmdText = "Select  'rowcount' = Count(*), Contetn_ID, Content_title,Emp_Name, Reading_Group, email  from vProcessDisplay where emp_ID = '" & rsUnread("Emp_ID") & "'  group by  Content_ID, COntent_title, emp_Name, Reading_Group, email"
            myRecordset.Open mySQLCmdText, myConn
            
            set Flds = myRecordset.Fields
            set iRowCount = Flds("rowcount")
      next
            while not myRecordset.eof
                  If iRowCount.Value = 0 then
                         Main = DTSTaskExecResult_Failure
                  else
                        dim unreaddoc
                        unreaddoc =  iRowCount.Value
                        strTo="myname<myemailaddrss@*******.com>"
                        strFrom="Document Central<process@****.******.com>"
                        strSubject="Unread document for -" & Date() & myRecordset("emp_Name")  
'  I would like to have a loop here that adds each content_ID to the message as there may be more than one document for each employee                        
strMessage="There are " & unreaddoc & " documents to be read "                              
                        Send_Mail  strTo, strFrom, strSubject, strMessage
                     Main = DTSTaskExecResult_Success
                  End If
                  myRecordset.movenext
            wend
      Main = DTSTaskExecResult_Success
End Function
Start Free Trial
[+][-]11.14.2007 at 10:19AM PST, ID: 20282224

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.14.2007 at 10:22AM PST, ID: 20282258

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.14.2007 at 10:41AM PST, ID: 20282426

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.14.2007 at 10:41AM PST, ID: 20282432

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.14.2007 at 10:54AM PST, ID: 20282573

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.14.2007 at 01:18PM PST, ID: 20283944

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.14.2007 at 05:20PM PST, ID: 20285783

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.14.2007 at 05:22PM PST, ID: 20285790

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.05.2008 at 03:57PM PST, ID: 20591705

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]01.10.2008 at 07:02PM PST, ID: 20633750

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: ActiveX, MS SQL DTS
Tags: activex, dts, script, package
Sign Up Now!
Solution Provided By: Computer101
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628