Active X Script help please

  • yes its working if i omit the last line. is my query correct?

  • i see only that you must specify the attachment as a string so:

     @attachments = 'C:\Documents and Settings\Desktop\test.xls'

    that is different from 

     @attachments = C:\Documents and Settings\Desktop\test.xls'

     

    sorry for my english...

  • a typo mistake

    but why is it working if i omit the attachments. i am getting the email. does it effect anything if i use xp_stopmail

  • I just modified my DTSPackage and the activexscript worked perfect with out failing the package.

    sorry its my fault; didnt make the connections properly.

    Thats really good. Thanks a lot RLoski for the script.

    But the xpsend_mail is not working properly. anyways i have one solution and i am good to go.

  • if anyone can give me a solution for xp_sendmail that would be great. I didnt use xp_sendmail till now and this is the first time i tested with it. Just curious to know as to how the attachments can be sent.

    Thanks.

     

  • Hi i am back again. The active x script works fine but a problem here.

    Function Main()

    if DTSGlobalVariables.Parent.Tasks("DTSTask_DTSDataPumpTask_2").CustomTask.RowsComplete < 0 then

    ' 0 or some other threshold

      Main = DTSStepScriptResult_DontExecuteTask

    else

      Main = DTSStepScriptResult_ExecuteTask

    end if

    end function

    what should be the threshold that i need to mention here. Here is my scenario

    one of my table doesnt have errors so the excel part shouldnt run and the other table has got errors this time the excel part should run. so if i mention the threshold as <0 i see that the excel part is running for both the scenarios. I tried putting different values but no luck. Please help me out.

    Thanks for your reply

  • Under what conditions does the task run?  You can set up a workflow from the datapump to this task.  You can state that you want the routine to only when there is an error (or is no error).

    Russ

    Russel Loski, MCSE Business Intelligence, Data Platform

  • The task should not run when the number of errored records is zero. if there are any errored records it should send to the excel and then send an email with the attachment of this excel. can u tell me as to how to set up the workflow from the datapump to this task.

    Thanks for ur reply.

  • Try:

    if DTSGlobalVariables.Parent.Tasks("DTSTask_DTSDataPumpTask_2").CustomTask.RowsComplete = 0 then

    Russel Loski, MCSE Business Intelligence, Data Platform

  • Hi Russel,

    I am back again. I was on vacation these days so couldnt check your message. I tried giving

    if DTSGlobalVariables.Parent.Tasks("DTSTask_DTSDataPumpTask_2").CustomTask.RowsComplete = 0

    before but it didnt work for me. Can you please help me out.

    Thanks for ur help

     

  • Can anyone please render any ideas and solutions on this. Thanks a lot for the help

  • '**********************************************************************

    ' Visual Basic ActiveX Script

    '************************************************************************

    Function Main()

    Dim strExecPkgTask'Execute Package Task Name

    strExecPkgTask = "DTSTask_DTSDataPumpTask_1"

    Call SetPackageParams(DTSGlobalVariables.Parent.Tasks(Cstr(strExecPkgTask)).CustomTask)

    Main = DTSTaskExecResult_Success

    End Function

    Sub SetPackageParams(objPkg)

    msgbox(objPkg.RowsComplete)

    End Sub

    try this one it will show you the rowsaffected

Viewing 12 posts - 16 through 26 (of 26 total)

You must be logged in to reply to this topic. Login to reply