![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I am trying to determine if any of the step in package failed. I am executing a package from within an ActiveX script. The execution of the package works fine; however, when I try to retrieve the error information, the call fails indicating Type missmatch or wrong number of arguments. Here is the sample code...Can anyone help... '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** Function Main() Dim ADOconn Dim ADOrst Dim oPackage Dim oStep Dim iErrorCode Dim iCount Dim sTaskName Dim sSource Dim sErrorDesc Dim sHelpFileName Dim iHelpContextID Dim sInterfaceID Dim sErrorMessage Dim sErrorNumConv Dim sProcessCategory Dim sProcessName Set oPackage = CreateObject("DTS.Package") sProcessName = "3002PCKG" oPackage.LoadFromSQLServer "(local)","","","256",,,,sProcessName oPackage.GlobalVariables.Item("giJobID").Value = DTSGlobalVariables("giJobID").Value oPackage.GlobalVariables.Item("gsAS400SourceUDL"). Value = DTSGlobalVariables("gsAS400SourceUDL").Value oPackage.GlobalVariables.Item("gsSourceUDL").Value = DTSGlobalVariables("gsSourceUDL").Value oPackage.GlobalVariables.Item("gsTargetUDL").Value = DTSGlobalVariables("gsTargetUDL").Value oPackage.Execute '************************************************* ************* ' GET STATUS AND ERROR '************************************************* ************* 'LOOK FOR STEPS THAT COMPLETED AND FAILED. For iCount = 1 To oPackage.Steps.Count If oPackage.Steps(iCount).ExecutionStatus = DTSStepExecStat_Completed Then If oPackage.Steps(iCount).ExecutionResult = DTSStepExecResult_Failure Then '************************************************* ************* 'GET THE STEP ERROR INFORMATION '************************************************* ************* iErrorCode = CLng(-1) iHelpContextID = CLng(-1) oPackage.Steps(iCount).GetExecutionErrorInfo iErrorCode, sSource, sErrorDesc, sHelpFileName, iHelpContextID, sInterfaceID If iErrorCode < 65536 And iErrorCode > -65536 Then sErrorNumConv = "x" & Hex(iErrorCode) & ", " & CStr(iErrorCode) Else sErrorNumConv = "x" & Hex(iErrorCode) & ", x" & _ Hex(iErrorCode And -65536) & " + " & CStr(iErrorCode And 65535) End If sMessage = sMessage & vbCrLf & _ "Step " & oPackage.Steps.Name & " failed, error: " & _ sErrorNumConv & vbCrLf & sDescr & vbCrLf End If End If Next Msgbox sMessage oPackage.Uninitialize() Set oPackage = Nothing Main = DTSTaskExecResult_Success End Function |
#3
| |||
| |||
|
|
It won't work in script because it uses by reference arguments, which must of the correct type, and you only have variant available, not the required string and int types. You will need to write this code in a full language. Implement it as a COM object and you can leverage it from VBScript though. Darren Green http://www.sqldts.com http://www.sqlis.com "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:0C5106FA-6A9C-496C-942B-624DE537664A (AT) microsoft (DOT) com... Hi, I am trying to determine if any of the step in package failed. I am executing a package from within an ActiveX script. The execution of the package works fine; however, when I try to retrieve the error information, the call fails indicating Type missmatch or wrong number of arguments. Here is the sample code...Can anyone help... '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** Function Main() Dim ADOconn Dim ADOrst Dim oPackage Dim oStep Dim iErrorCode Dim iCount Dim sTaskName Dim sSource Dim sErrorDesc Dim sHelpFileName Dim iHelpContextID Dim sInterfaceID Dim sErrorMessage Dim sErrorNumConv Dim sProcessCategory Dim sProcessName Set oPackage = CreateObject("DTS.Package") sProcessName = "3002PCKG" oPackage.LoadFromSQLServer "(local)","","","256",,,,sProcessName oPackage.GlobalVariables.Item("giJobID").Value = DTSGlobalVariables("giJobID").Value oPackage.GlobalVariables.Item("gsAS400SourceUDL"). Value = DTSGlobalVariables("gsAS400SourceUDL").Value oPackage.GlobalVariables.Item("gsSourceUDL").Value = DTSGlobalVariables("gsSourceUDL").Value oPackage.GlobalVariables.Item("gsTargetUDL").Value = DTSGlobalVariables("gsTargetUDL").Value oPackage.Execute '************************************************* ************* ' GET STATUS AND ERROR '************************************************* ************* 'LOOK FOR STEPS THAT COMPLETED AND FAILED. For iCount = 1 To oPackage.Steps.Count If oPackage.Steps(iCount).ExecutionStatus = DTSStepExecStat_Completed Then If oPackage.Steps(iCount).ExecutionResult = DTSStepExecResult_Failure Then '************************************************* ************* 'GET THE STEP ERROR INFORMATION '************************************************* ************* iErrorCode = CLng(-1) iHelpContextID = CLng(-1) oPackage.Steps(iCount).GetExecutionErrorInfo iErrorCode, sSource, sErrorDesc, sHelpFileName, iHelpContextID, sInterfaceID If iErrorCode < 65536 And iErrorCode > -65536 Then sErrorNumConv = "x" & Hex(iErrorCode) & ", " & CStr(iErrorCode) Else sErrorNumConv = "x" & Hex(iErrorCode) & ", x" & _ Hex(iErrorCode And -65536) & " + " & CStr(iErrorCode And 65535) End If sMessage = sMessage & vbCrLf & _ "Step " & oPackage.Steps.Name & " failed, error: " & _ sErrorNumConv & vbCrLf & sDescr & vbCrLf End If End If Next Msgbox sMessage oPackage.Uninitialize() Set oPackage = Nothing Main = DTSTaskExecResult_Success End Function |
#4
| |||
| |||
|
|
Hi Darren, I very greatful for your respond. Unfortunately, I have no knowledge of developing COM. Do you know how I can go about this or develop the COM object and calling it from ActiveX script? Any insight greatly appreciate it. "Darren Green" wrote: It won't work in script because it uses by reference arguments, which must of the correct type, and you only have variant available, not the required string and int types. You will need to write this code in a full language. Implement it as a COM object and you can leverage it from VBScript though. Darren Green http://www.sqldts.com http://www.sqlis.com "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:0C5106FA-6A9C-496C-942B-624DE537664A (AT) microsoft (DOT) com... Hi, I am trying to determine if any of the step in package failed. I am executing a package from within an ActiveX script. The execution of the package works fine; however, when I try to retrieve the error information, the call fails indicating Type missmatch or wrong number of arguments. Here is the sample code...Can anyone help... '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** Function Main() Dim ADOconn Dim ADOrst Dim oPackage Dim oStep Dim iErrorCode Dim iCount Dim sTaskName Dim sSource Dim sErrorDesc Dim sHelpFileName Dim iHelpContextID Dim sInterfaceID Dim sErrorMessage Dim sErrorNumConv Dim sProcessCategory Dim sProcessName Set oPackage = CreateObject("DTS.Package") sProcessName = "3002PCKG" oPackage.LoadFromSQLServer "(local)","","","256",,,,sProcessName oPackage.GlobalVariables.Item("giJobID").Value = DTSGlobalVariables("giJobID").Value oPackage.GlobalVariables.Item("gsAS400SourceUDL"). Value = DTSGlobalVariables("gsAS400SourceUDL").Value oPackage.GlobalVariables.Item("gsSourceUDL").Value = DTSGlobalVariables("gsSourceUDL").Value oPackage.GlobalVariables.Item("gsTargetUDL").Value = DTSGlobalVariables("gsTargetUDL").Value oPackage.Execute '************************************************* ************* ' GET STATUS AND ERROR '************************************************* ************* 'LOOK FOR STEPS THAT COMPLETED AND FAILED. For iCount = 1 To oPackage.Steps.Count If oPackage.Steps(iCount).ExecutionStatus = DTSStepExecStat_Completed Then If oPackage.Steps(iCount).ExecutionResult = DTSStepExecResult_Failure Then '************************************************* ************* 'GET THE STEP ERROR INFORMATION '************************************************* ************* iErrorCode = CLng(-1) iHelpContextID = CLng(-1) oPackage.Steps(iCount).GetExecutionErrorInfo iErrorCode, sSource, sErrorDesc, sHelpFileName, iHelpContextID, sInterfaceID If iErrorCode < 65536 And iErrorCode > -65536 Then sErrorNumConv = "x" & Hex(iErrorCode) & ", " & CStr(iErrorCode) Else sErrorNumConv = "x" & Hex(iErrorCode) & ", x" & _ Hex(iErrorCode And -65536) & " + " & CStr(iErrorCode And 65535) End If sMessage = sMessage & vbCrLf & _ "Step " & oPackage.Steps.Name & " failed, error: " & _ sErrorNumConv & vbCrLf & sDescr & vbCrLf End If End If Next Msgbox sMessage oPackage.Uninitialize() Set oPackage = Nothing Main = DTSTaskExecResult_Success End Function |
#5
| |||
| |||
|
|
Do you have a compiler/IDE, VB for example? "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:E4E2E57A-73D3-4980-996B-A30AB01534B7 (AT) microsoft (DOT) com... Hi Darren, I very greatful for your respond. Unfortunately, I have no knowledge of developing COM. Do you know how I can go about this or develop the COM object and calling it from ActiveX script? Any insight greatly appreciate it. "Darren Green" wrote: It won't work in script because it uses by reference arguments, which must of the correct type, and you only have variant available, not the required string and int types. You will need to write this code in a full language. Implement it as a COM object and you can leverage it from VBScript though. Darren Green http://www.sqldts.com http://www.sqlis.com "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:0C5106FA-6A9C-496C-942B-624DE537664A (AT) microsoft (DOT) com... Hi, I am trying to determine if any of the step in package failed. I am executing a package from within an ActiveX script. The execution of the package works fine; however, when I try to retrieve the error information, the call fails indicating Type missmatch or wrong number of arguments. Here is the sample code...Can anyone help... '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** Function Main() Dim ADOconn Dim ADOrst Dim oPackage Dim oStep Dim iErrorCode Dim iCount Dim sTaskName Dim sSource Dim sErrorDesc Dim sHelpFileName Dim iHelpContextID Dim sInterfaceID Dim sErrorMessage Dim sErrorNumConv Dim sProcessCategory Dim sProcessName Set oPackage = CreateObject("DTS.Package") sProcessName = "3002PCKG" oPackage.LoadFromSQLServer "(local)","","","256",,,,sProcessName oPackage.GlobalVariables.Item("giJobID").Value = DTSGlobalVariables("giJobID").Value oPackage.GlobalVariables.Item("gsAS400SourceUDL"). Value = DTSGlobalVariables("gsAS400SourceUDL").Value oPackage.GlobalVariables.Item("gsSourceUDL").Value = DTSGlobalVariables("gsSourceUDL").Value oPackage.GlobalVariables.Item("gsTargetUDL").Value = DTSGlobalVariables("gsTargetUDL").Value oPackage.Execute '************************************************* ************* ' GET STATUS AND ERROR '************************************************* ************* 'LOOK FOR STEPS THAT COMPLETED AND FAILED. For iCount = 1 To oPackage.Steps.Count If oPackage.Steps(iCount).ExecutionStatus = DTSStepExecStat_Completed Then If oPackage.Steps(iCount).ExecutionResult = DTSStepExecResult_Failure Then '************************************************* ************* 'GET THE STEP ERROR INFORMATION '************************************************* ************* iErrorCode = CLng(-1) iHelpContextID = CLng(-1) oPackage.Steps(iCount).GetExecutionErrorInfo iErrorCode, sSource, sErrorDesc, sHelpFileName, iHelpContextID, sInterfaceID If iErrorCode < 65536 And iErrorCode > -65536 Then sErrorNumConv = "x" & Hex(iErrorCode) & ", " & CStr(iErrorCode) Else sErrorNumConv = "x" & Hex(iErrorCode) & ", x" & _ Hex(iErrorCode And -65536) & " + " & CStr(iErrorCode And 65535) End If sMessage = sMessage & vbCrLf & _ "Step " & oPackage.Steps.Name & " failed, error: " & _ sErrorNumConv & vbCrLf & sDescr & vbCrLf End If End If Next Msgbox sMessage oPackage.Uninitialize() Set oPackage = Nothing Main = DTSTaskExecResult_Success End Function |
#6
| |||
| |||
|
|
Yes, I have Visual Basic 6.0 installed... "Darren Green" wrote: Do you have a compiler/IDE, VB for example? "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:E4E2E57A-73D3-4980-996B-A30AB01534B7 (AT) microsoft (DOT) com... Hi Darren, I very greatful for your respond. Unfortunately, I have no knowledge of developing COM. Do you know how I can go about this or develop the COM object and calling it from ActiveX script? Any insight greatly appreciate it. "Darren Green" wrote: It won't work in script because it uses by reference arguments, which must of the correct type, and you only have variant available, not the required string and int types. You will need to write this code in a full language. Implement it as a COM object and you can leverage it from VBScript though. Darren Green http://www.sqldts.com http://www.sqlis.com "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:0C5106FA-6A9C-496C-942B-624DE537664A (AT) microsoft (DOT) com... Hi, I am trying to determine if any of the step in package failed. I am executing a package from within an ActiveX script. The execution of the package works fine; however, when I try to retrieve the error information, the call fails indicating Type missmatch or wrong number of arguments. Here is the sample code...Can anyone help... '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** Function Main() Dim ADOconn Dim ADOrst Dim oPackage Dim oStep Dim iErrorCode Dim iCount Dim sTaskName Dim sSource Dim sErrorDesc Dim sHelpFileName Dim iHelpContextID Dim sInterfaceID Dim sErrorMessage Dim sErrorNumConv Dim sProcessCategory Dim sProcessName Set oPackage = CreateObject("DTS.Package") sProcessName = "3002PCKG" oPackage.LoadFromSQLServer "(local)","","","256",,,,sProcessName oPackage.GlobalVariables.Item("giJobID").Value = DTSGlobalVariables("giJobID").Value oPackage.GlobalVariables.Item("gsAS400SourceUDL"). Value = DTSGlobalVariables("gsAS400SourceUDL").Value oPackage.GlobalVariables.Item("gsSourceUDL").Value = DTSGlobalVariables("gsSourceUDL").Value oPackage.GlobalVariables.Item("gsTargetUDL").Value = DTSGlobalVariables("gsTargetUDL").Value oPackage.Execute '************************************************* ************* ' GET STATUS AND ERROR '************************************************* ************* 'LOOK FOR STEPS THAT COMPLETED AND FAILED. For iCount = 1 To oPackage.Steps.Count If oPackage.Steps(iCount).ExecutionStatus = DTSStepExecStat_Completed Then If oPackage.Steps(iCount).ExecutionResult = DTSStepExecResult_Failure Then '************************************************* ************* 'GET THE STEP ERROR INFORMATION '************************************************* ************* iErrorCode = CLng(-1) iHelpContextID = CLng(-1) oPackage.Steps(iCount).GetExecutionErrorInfo iErrorCode, sSource, sErrorDesc, sHelpFileName, iHelpContextID, sInterfaceID If iErrorCode < 65536 And iErrorCode > -65536 Then sErrorNumConv = "x" & Hex(iErrorCode) & ", " & CStr(iErrorCode) Else sErrorNumConv = "x" & Hex(iErrorCode) & ", x" & _ Hex(iErrorCode And -65536) & " + " & CStr(iErrorCode And 65535) End If sMessage = sMessage & vbCrLf & _ "Step " & oPackage.Steps.Name & " failed, error: " & _ sErrorNumConv & vbCrLf & sDescr & vbCrLf End If End If Next Msgbox sMessage oPackage.Uninitialize() Set oPackage = Nothing Main = DTSTaskExecResult_Success End Function |
#7
| |||
| |||
|
|
Tools & Tasks (http://www.sqldts.com/default.aspx?272) DTS ActiveX Helper http://www.sqldts.com/redir.aspx?45 A simple COM component which wraps the GetExecutionErrorInfo method using variant types for returning data, compatible with ActiveX Script Tasks. Full source code included (VB6). Darren Green http://www.sqldts.com http://www.sqlis.com "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:E6A76EAE-491A-4DB5-BC4E-3AC9DEE2B6D0 (AT) microsoft (DOT) com... Yes, I have Visual Basic 6.0 installed... "Darren Green" wrote: Do you have a compiler/IDE, VB for example? "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:E4E2E57A-73D3-4980-996B-A30AB01534B7 (AT) microsoft (DOT) com... Hi Darren, I very greatful for your respond. Unfortunately, I have no knowledge of developing COM. Do you know how I can go about this or develop the COM object and calling it from ActiveX script? Any insight greatly appreciate it. "Darren Green" wrote: It won't work in script because it uses by reference arguments, which must of the correct type, and you only have variant available, not the required string and int types. You will need to write this code in a full language. Implement it as a COM object and you can leverage it from VBScript though. Darren Green http://www.sqldts.com http://www.sqlis.com "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:0C5106FA-6A9C-496C-942B-624DE537664A (AT) microsoft (DOT) com... Hi, I am trying to determine if any of the step in package failed. I am executing a package from within an ActiveX script. The execution of the package works fine; however, when I try to retrieve the error information, the call fails indicating Type missmatch or wrong number of arguments. Here is the sample code...Can anyone help... '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** Function Main() Dim ADOconn Dim ADOrst Dim oPackage Dim oStep Dim iErrorCode Dim iCount Dim sTaskName Dim sSource Dim sErrorDesc Dim sHelpFileName Dim iHelpContextID Dim sInterfaceID Dim sErrorMessage Dim sErrorNumConv Dim sProcessCategory Dim sProcessName Set oPackage = CreateObject("DTS.Package") sProcessName = "3002PCKG" oPackage.LoadFromSQLServer "(local)","","","256",,,,sProcessName oPackage.GlobalVariables.Item("giJobID").Value = DTSGlobalVariables("giJobID").Value oPackage.GlobalVariables.Item("gsAS400SourceUDL"). Value = DTSGlobalVariables("gsAS400SourceUDL").Value oPackage.GlobalVariables.Item("gsSourceUDL").Value = DTSGlobalVariables("gsSourceUDL").Value oPackage.GlobalVariables.Item("gsTargetUDL").Value = DTSGlobalVariables("gsTargetUDL").Value oPackage.Execute '************************************************* ************* ' GET STATUS AND ERROR '************************************************* ************* 'LOOK FOR STEPS THAT COMPLETED AND FAILED. For iCount = 1 To oPackage.Steps.Count If oPackage.Steps(iCount).ExecutionStatus = DTSStepExecStat_Completed Then If oPackage.Steps(iCount).ExecutionResult = DTSStepExecResult_Failure Then '************************************************* ************* 'GET THE STEP ERROR INFORMATION '************************************************* ************* iErrorCode = CLng(-1) iHelpContextID = CLng(-1) oPackage.Steps(iCount).GetExecutionErrorInfo iErrorCode, sSource, sErrorDesc, sHelpFileName, iHelpContextID, sInterfaceID If iErrorCode < 65536 And iErrorCode > -65536 Then sErrorNumConv = "x" & Hex(iErrorCode) & ", " & CStr(iErrorCode) Else sErrorNumConv = "x" & Hex(iErrorCode) & ", x" & _ Hex(iErrorCode And -65536) & " + " & CStr(iErrorCode And 65535) End If sMessage = sMessage & vbCrLf & _ "Step " & oPackage.Steps.Name & " failed, error: " & _ sErrorNumConv & vbCrLf & sDescr & vbCrLf End If End If Next Msgbox sMessage oPackage.Uninitialize() Set oPackage = Nothing Main = DTSTaskExecResult_Success End Function |
#8
| |||
| |||
|
|
Tools & Tasks (http://www.sqldts.com/default.aspx?272) DTS ActiveX Helper http://www.sqldts.com/redir.aspx?45 A simple COM component which wraps the GetExecutionErrorInfo method using variant types for returning data, compatible with ActiveX Script Tasks. Full source code included (VB6). Darren Green http://www.sqldts.com http://www.sqlis.com "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:E6A76EAE-491A-4DB5-BC4E-3AC9DEE2B6D0 (AT) microsoft (DOT) com... Yes, I have Visual Basic 6.0 installed... "Darren Green" wrote: Do you have a compiler/IDE, VB for example? "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:E4E2E57A-73D3-4980-996B-A30AB01534B7 (AT) microsoft (DOT) com... Hi Darren, I very greatful for your respond. Unfortunately, I have no knowledge of developing COM. Do you know how I can go about this or develop the COM object and calling it from ActiveX script? Any insight greatly appreciate it. "Darren Green" wrote: It won't work in script because it uses by reference arguments, which must of the correct type, and you only have variant available, not the required string and int types. You will need to write this code in a full language. Implement it as a COM object and you can leverage it from VBScript though. Darren Green http://www.sqldts.com http://www.sqlis.com "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:0C5106FA-6A9C-496C-942B-624DE537664A (AT) microsoft (DOT) com... Hi, I am trying to determine if any of the step in package failed. I am executing a package from within an ActiveX script. The execution of the package works fine; however, when I try to retrieve the error information, the call fails indicating Type missmatch or wrong number of arguments. Here is the sample code...Can anyone help... '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** Function Main() Dim ADOconn Dim ADOrst Dim oPackage Dim oStep Dim iErrorCode Dim iCount Dim sTaskName Dim sSource Dim sErrorDesc Dim sHelpFileName Dim iHelpContextID Dim sInterfaceID Dim sErrorMessage Dim sErrorNumConv Dim sProcessCategory Dim sProcessName Set oPackage = CreateObject("DTS.Package") sProcessName = "3002PCKG" oPackage.LoadFromSQLServer "(local)","","","256",,,,sProcessName oPackage.GlobalVariables.Item("giJobID").Value = DTSGlobalVariables("giJobID").Value oPackage.GlobalVariables.Item("gsAS400SourceUDL"). Value = DTSGlobalVariables("gsAS400SourceUDL").Value oPackage.GlobalVariables.Item("gsSourceUDL").Value = DTSGlobalVariables("gsSourceUDL").Value oPackage.GlobalVariables.Item("gsTargetUDL").Value = DTSGlobalVariables("gsTargetUDL").Value oPackage.Execute '************************************************* ************* ' GET STATUS AND ERROR '************************************************* ************* 'LOOK FOR STEPS THAT COMPLETED AND FAILED. For iCount = 1 To oPackage.Steps.Count If oPackage.Steps(iCount).ExecutionStatus = DTSStepExecStat_Completed Then If oPackage.Steps(iCount).ExecutionResult = DTSStepExecResult_Failure Then '************************************************* ************* 'GET THE STEP ERROR INFORMATION '************************************************* ************* iErrorCode = CLng(-1) iHelpContextID = CLng(-1) oPackage.Steps(iCount).GetExecutionErrorInfo iErrorCode, sSource, sErrorDesc, sHelpFileName, iHelpContextID, sInterfaceID If iErrorCode < 65536 And iErrorCode > -65536 Then sErrorNumConv = "x" & Hex(iErrorCode) & ", " & CStr(iErrorCode) Else sErrorNumConv = "x" & Hex(iErrorCode) & ", x" & _ Hex(iErrorCode And -65536) & " + " & CStr(iErrorCode And 65535) End If sMessage = sMessage & vbCrLf & _ "Step " & oPackage.Steps.Name & " failed, error: " & _ sErrorNumConv & vbCrLf & sDescr & vbCrLf End If End If Next Msgbox sMessage oPackage.Uninitialize() Set oPackage = Nothing Main = DTSTaskExecResult_Success End Function |
#9
| |||
| |||
|
|
Hi Darren, I am getting error while accessing the DTS ActiveX Helper webpage. The error indicates that the web page does not exist. "Darren Green" wrote: Tools & Tasks (http://www.sqldts.com/default.aspx?272) DTS ActiveX Helper http://www.sqldts.com/redir.aspx?45 A simple COM component which wraps the GetExecutionErrorInfo method using variant types for returning data, compatible with ActiveX Script Tasks. Full source code included (VB6). Darren Green http://www.sqldts.com http://www.sqlis.com "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:E6A76EAE-491A-4DB5-BC4E-3AC9DEE2B6D0 (AT) microsoft (DOT) com... Yes, I have Visual Basic 6.0 installed... "Darren Green" wrote: Do you have a compiler/IDE, VB for example? "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:E4E2E57A-73D3-4980-996B-A30AB01534B7 (AT) microsoft (DOT) com... Hi Darren, I very greatful for your respond. Unfortunately, I have no knowledge of developing COM. Do you know how I can go about this or develop the COM object and calling it from ActiveX script? Any insight greatly appreciate it. "Darren Green" wrote: It won't work in script because it uses by reference arguments, which must of the correct type, and you only have variant available, not the required string and int types. You will need to write this code in a full language. Implement it as a COM object and you can leverage it from VBScript though. Darren Green http://www.sqldts.com http://www.sqlis.com "fsanchez" <fsanchez (AT) discussions (DOT) microsoft.com> wrote in message news:0C5106FA-6A9C-496C-942B-624DE537664A (AT) microsoft (DOT) com... Hi, I am trying to determine if any of the step in package failed. I am executing a package from within an ActiveX script. The execution of the package works fine; however, when I try to retrieve the error information, the call fails indicating Type missmatch or wrong number of arguments. Here is the sample code...Can anyone help... '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** Function Main() Dim ADOconn Dim ADOrst Dim oPackage Dim oStep Dim iErrorCode Dim iCount Dim sTaskName Dim sSource Dim sErrorDesc Dim sHelpFileName Dim iHelpContextID Dim sInterfaceID Dim sErrorMessage Dim sErrorNumConv Dim sProcessCategory Dim sProcessName Set oPackage = CreateObject("DTS.Package") sProcessName = "3002PCKG" oPackage.LoadFromSQLServer "(local)","","","256",,,,sProcessName oPackage.GlobalVariables.Item("giJobID").Value = DTSGlobalVariables("giJobID").Value oPackage.GlobalVariables.Item("gsAS400SourceUDL"). Value = DTSGlobalVariables("gsAS400SourceUDL").Value oPackage.GlobalVariables.Item("gsSourceUDL").Value = DTSGlobalVariables("gsSourceUDL").Value oPackage.GlobalVariables.Item("gsTargetUDL").Value = DTSGlobalVariables("gsTargetUDL").Value oPackage.Execute '************************************************* ************* ' GET STATUS AND ERROR '************************************************* ************* 'LOOK FOR STEPS THAT COMPLETED AND FAILED. For iCount = 1 To oPackage.Steps.Count If oPackage.Steps(iCount).ExecutionStatus = DTSStepExecStat_Completed Then If oPackage.Steps(iCount).ExecutionResult = DTSStepExecResult_Failure Then '************************************************* ************* 'GET THE STEP ERROR INFORMATION '************************************************* ************* iErrorCode = CLng(-1) iHelpContextID = CLng(-1) oPackage.Steps(iCount).GetExecutionErrorInfo iErrorCode, sSource, sErrorDesc, sHelpFileName, iHelpContextID, sInterfaceID If iErrorCode < 65536 And iErrorCode > -65536 Then sErrorNumConv = "x" & Hex(iErrorCode) & ", " & CStr(iErrorCode) Else sErrorNumConv = "x" & Hex(iErrorCode) & ", x" & _ Hex(iErrorCode And -65536) & " + " & CStr(iErrorCode And 65535) End If sMessage = sMessage & vbCrLf & _ "Step " & oPackage.Steps.Name & " failed, error: " & _ sErrorNumConv & vbCrLf & sDescr & vbCrLf End If End If Next Msgbox sMessage oPackage.Uninitialize() Set oPackage = Nothing Main = DTSTaskExecResult_Success End Function |
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |