Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
&引用;无效的类字符串";在VB.NET中尝试执行DTS包时_.net_Sql Server_Dts - Fatal编程技术网

&引用;无效的类字符串";在VB.NET中尝试执行DTS包时

&引用;无效的类字符串";在VB.NET中尝试执行DTS包时,.net,sql-server,dts,.net,Sql Server,Dts,我有一个DTS包,它运行在我们的MS SQL Server 2000数据库服务器上,需要一种方法让用户从自己的机器上执行它。(软件包创建文件,然后由我的应用程序传输到客户端计算机。)我已在应用程序中包含“Microsoft DTSPackage Object Library”COM引用,但在执行软件包的第一步时仍会出现“Invalid Class String”错误。我还尝试注册SQL Server 2000光盘的redist.txt文件中指定的所有DLL。如有任何想法或建议,将不胜感激。DTS

我有一个DTS包,它运行在我们的MS SQL Server 2000数据库服务器上,需要一种方法让用户从自己的机器上执行它。(软件包创建文件,然后由我的应用程序传输到客户端计算机。)我已在应用程序中包含“Microsoft DTSPackage Object Library”COM引用,但在执行软件包的第一步时仍会出现“Invalid Class String”错误。我还尝试注册SQL Server 2000光盘的redist.txt文件中指定的所有DLL。如有任何想法或建议,将不胜感激。DTS包非常简单。它只是将数据从SQL数据库复制到VisualFoxPro表中。下面是我执行包的代码(大部分代码取自Microsoft的KB文章:)


如果您在用户PC上安装完整的SQL Enterprise Manager客户端工具,作为测试,他们能否成功运行该工具?也许你遗漏了一些要求。请记住,DTS包本身将在用户的PC上本地执行,而不是在服务器上执行。

尝试向REGASM/CODEBASE注册DLL

我安装了所有客户端工具,但仍然收到相同的错误。我使用的代码过去在客户端机器上工作,没有任何DLL注册要求。在未注册任何DTS DLL的计算机上运行应用程序时,我收到另一条错误消息:检索CLSID为{10020200-EB1C-11CF-AE6E-00AA004A34D5}的组件的COM类工厂失败,原因是以下错误:80040154。经过一些调查,这篇知识库文章似乎提供了一个解决方案:。我试过之后再跟进。谢谢
        Dim pkg As DTS.Package
        pkg = New DTS.Package
        Dim cpContainer As System.Runtime.InteropServices.ComTypes.IConnectionPointContainer
        cpContainer = CType(pkg, System.Runtime.InteropServices.ComTypes.IConnectionPointContainer)
        Dim cpPoint As System.Runtime.InteropServices.ComTypes.IConnectionPoint
        Dim PES As PackageEventsSink = New PackageEventsSink

        Dim guid As Guid = New Guid("10020605-EB1C-11CF-AE6E-00AA004A34D5")

        cpPoint = Nothing
        cpContainer.FindConnectionPoint(guid, cpPoint)

        Dim intCookie As Integer
        cpPoint.Advise(PES, intCookie)

        pkg.LoadFromSQLServer(DTS_SERVER_NAME, , , DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection, dtsPassword, , , dtsName, Nothing)
        If pkg Is Nothing Then Throw New ApplicationException("The DTS Package could not be loaded from the SQL Server.")

        Dim pkgStep As DTS.Step
        For Each pkgStep In pkg.Steps
            pkgStep.Execute()
        Next

        pkg.UnInitialize()
        pkg = Nothing

        cpPoint.Unadvise(intCookie)
        cpPoint = Nothing
        cpContainer = Nothing
        PES = Nothing