如何从 VB 脚本操作和运行远程 SSIS 包?

发布于 2024-12-01 01:13:28 字数 1262 浏览 0 评论 0原文

我有一些可以修改的旧 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

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

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

I have some old VB Script code that I can modify but I cannot migrate the app to a new language...

This VB Script basically used to connect to a SQL 2000 Server and manipulate the connections of the package before running it, which would output a flatfile database locally.

Now I do not have a DTS package, I just have an SSIS package.

The code used to be this:

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"

I am now trying to modify the code to

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"

First error I got is:
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or mother: 'DTSpkg.LoadFromSQLServer'
/main.asp.241

This I am guessing will be one of the many hurdles I will probably have to overcome.
However, I have struggled to find a solution to this by Google searching.

Has anyone got an idea of what I need to do to get IIS running this new code?
Or any problems I am likely to face trying to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丑疤怪 2024-12-08 01:13:28

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

Your best option would be to change your SSIS packages to use Package Configurations for the Connection Managers. If you use SQL Server configurations, when the package is loaded and executed, it will change the Connection Managers based on what it finds in the SQL Server configuration table. So your steps would be to alter the data in that table, then start the packages - no direct manipulation of the packages is necessary.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文