VB6上功能的返回值



我有一个关于返回vb6.0中函数值的问题.. below是我的代码

Public Function tracePackageError(oPackage As DTS.Package) As String
Dim ErrorCode As Long
Dim ErrorSource As String
Dim ErrorDescription As String
Dim ErrorHelpFile As String
Dim ErrorHelpContext As Long
Dim ErrorIDofInterfaceWithError As String
Dim i As Integer
    For i = 1 To oPackage.Steps.Count
            If oPackage.Steps(i).ExecutionResult = DTSStepExecResult_Failure Then
               oPackage.Steps(i).GetExecutionErrorInfo ErrorCode, ErrorSource, ErrorDescription, _
               ErrorHelpFile, ErrorHelpContext, ErrorIDofInterfaceWithError                                                                                           
            End If
    Next i
End Function

我将如何返回功能的价值?请帮助:(

我认为这对您有用...

Public Function tracePackageError(oPackage As DTS.Package) As String
Dim ErrorCode As Long
Dim ErrorSource As String
Dim ErrorDescription As String
Dim ErrorHelpFile As String
Dim ErrorHelpContext As Long
Dim ErrorIDofInterfaceWithError As String
Dim i As Integer
    For i = 1 To oPackage.Steps.Count
            If oPackage.Steps(i).ExecutionResult = DTSStepExecResult_Failure Then
               oPackage.Steps(i).GetExecutionErrorInfo ErrorCode, ErrorSource, ErrorDescription, _
               ErrorHelpFile, ErrorHelpContext, ErrorIDofInterfaceWithError 
               tracePackageError = ErrorDescription                                                                      
            End If
    Next i
End Function

尝试一下,让我知道

最新更新