从VB6运行SSIS包

时间:2009-09-29 12:11:14

标签: vb6 ssis

有谁能告诉我如何从VB6运行SSIS包?

2 个答案:

答案 0 :(得分:5)

Dim dtsApp As Application
Dim package As IDTSPackage90

Set dtsApp = New Application

Set package = dtsApp.LoadPackage("c:\MyPackage.dtsx", True, Nothing)

package.Execute

您需要添加对Microsoft DTS Runtime 1.0的引用。它应位于C:\ Program Files \ Microsoft SQL Server \ 90 \ DTS \ Binn \ DTS.dll

答案 1 :(得分:3)

您可以从命令行调用dtexec

    Private Sub CmdRun_Click()
       Dim result
       result = Shell("dtexec /f c:\mypackage.dtsx", vbNormalFocus)
    End Sub