Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trapping Errors When Running DTS Package from VS.NET 2003

Status
Not open for further replies.

dldev

Programmer
Joined
Sep 4, 2007
Messages
33
Location
US
Hello,

here is my code which works to run a DTS package from my VB.NET app:

Public Sub ExecutePackage(ByVal sServer As String, ByVal sPackageName As String, ByVal sPackageGuid As String)
Dim opak As New Package2Class
opak.LoadFromSQLServer(sServer, "test", "access", , , sPackageGuid, , sPackageName)
opak.Execute()
End Sub

Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem5.Click
Dim oConsol As New IMPORT.Consolidate
Me.txtMsg.Text = vbNullString
AppendMsg("Loading validation process...")

'TO DO: Trap DTS Failure

AppendMsg("Invoices Exported")
AppendMsg("Invoice Export Complete")
oConsol.ExecutePackage("TESTSERVER", "TEST", "{8920CA6F-58B7-46C1-8C2C-F4B3D1E426B6}")
End Sub

Not sure how to trap a the error should the DTS package fail. I don't need a specific error, just a general failure error. If someone could show me I'd really appreciate it.

Thanks,
Dennis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top