【问题标题】:How can I manipulate and run a remote SSIS package from VB Script?如何从 VB 脚本操作和运行远程 SSIS 包?
【发布时间】:2011-08-23 16:20:44
【问题描述】:

我有一些可以修改的旧 VB 脚本代码,但我无法将应用程序迁移到新语言...

这个 VB 脚本主要用于连接到 SQL 2000 Server 并在运行它之前操作包的连接,这将在本地输出一个平面文件数据库。

现在我没有 DTS 包,我只有一个 SSIS 包。

以前的代码是这样的:

dim DTScon
dim DTSpkg
set DTSpkg = Server.CreateObject("DTS.Package")
DTSpkg.LoadFromSQLServer "mysqlserver","myuser","mypass",dts.DTSSQLStgFlag_Default,,,,"MyPackageName"

set DTScon = DTSpkg.Connections.Item("Conn1")
set DTScon.UserId = "conn_username"
set DTScon.Password = "conn_password"
set DTScnp = DTScon.ConnectionProperties.Item("Data Source");
DTScnp.Value = "c:\path\to\output\flatfile"

我现在正在尝试将代码修改为

dim DTScon
dim DTSpkg
set DTSpkg = Server.CreateObject("DTS.Application")
DTSpkg.LoadFromSQLServer "mysqlserver","myuser","mypass",dts.DTSSQLStgFlag_Default,,,,"MyPackageName"

set DTScon = DTSpkg.Connections.Item("Conn1")
set DTScon.UserId = "conn_username"
set DTScon.Password = "conn_password"
set DTScnp = DTScon.ConnectionProperties.Item("Data Source");
DTScnp.Value = "c:\path\to\output\flatfile"

我得到的第一个错误是: Microsoft VBScript 运行时错误“800a01b6” 对象不支持此属性或母亲:'DTSpkg.LoadFromSQLServer' /main.asp.241

我猜这将是我可能必须克服的众多障碍之一。 但是,我一直在努力通过 Google 搜索找到解决方案。

有没有人知道我需要做什么才能让 IIS 运行这个新代码? 或者我在尝试这样做时可能会遇到什么问题?

【问题讨论】:

    标签: sql-server sql-server-2005 ssis sql-server-2000


    【解决方案1】:

    您最好的选择是更改您的 SSIS 包以使用连接管理器的包配置。如果您使用 SQL Server 配置,则在加载和执行包时,它将根据在 SQL Server 配置表中找到的内容更改连接管理器。因此,您的步骤是更改该表中的数据,然后启动包 - 无需直接操作包。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-12
      • 2010-12-26
      • 2019-11-12
      相关资源
      最近更新 更多