Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2005

    Arrow Unanswered: Run DTS Package from Visual Basic 6.3

    Anyone have any code i can use to call a DTS package from Visual Basic. I would like to have an outlook macro that will run a dts package when i receive an email. All i need is the code that will call a dts package for a sql server that is not local to the box. I've tried this code but i get an error
    run_tmie error '-2147217900 (80040e14)' automation error

    Public Sub main()

    Dim oPkg As DTS.Package2
    Set oPkg = New DTS.Package2

    oPkg.LoadFromSQLServer MyServerName, MyUserName, MyPassword, , MyDTSPackageName


    Set oPkg = Nothing

    End Sub

    Thanks in advance.

  2. #2
    Join Date
    Dec 2004
    CA, USA
    I use the following in a VBScript. Will work in VB also.

    strDTSRun_Command = "dtsrun.exe /Sservername /E /Ndtspackagename"
    iWindowStyle = 10
    bWaitOnReturn = true
    Return = WshShell.Run(strDTSRun_Command, iWindowStyle, bWaitOnReturn)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts