ArizonaRedneck
Programmer
hi, I'm trying to execute a package from a sql server on my local box. I have added all references neccessary for it to run. When I run the package from enterprise manager, it works fine. When I run it from my aspx page it throws an error. Something about data pump task or something like that.
I put a breakpoint in the code on the line where it executes the package to make sure that it found the correct one and it does. I have tried using both DTS.Package2 and DTS.Package and neither of them work. Any help would be greatly appreciated.
-
"Do your duty in all things. You cannot do more, you should never wish to do less." Robert E. Lee
Code:
Dim pkg As DTS.Package2
Dim oStep As DTS.Step
Try
pkg = New DTS.Package2
pkg.LoadFromSQLServer("localhost", "Uname", "Pword", _
DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, _
"", "", "", PackageName, Nothing)
pkg.AutoCommitTransaction = True
For Each oStep In pkg.Steps
oStep.ExecuteInMainThread = True
Next
pkg.Execute()
For Each oStep In pkg.Steps
If oStep.ExecutionResult = DTSStepExecResult.DTSStepExecResult_Failure Then
Throw New Exception("Error while processing " & pkg.Name & " on step " & oStep.Name)
End If
Next
Catch ex As System.Runtime.InteropServices.COMException
Throw ex
Catch ex As Exception
Throw ex
Finally
pkg.UnInitialize()
pkg = Nothing
End Try
-
"Do your duty in all things. You cannot do more, you should never wish to do less." Robert E. Lee