views:

366

answers:

2

I have a DTS package that runs on our MS SQL Server 2000 database server, and need a way for users to execute it from their own machines. (The package creates files that are then transferred by my application to the client machine.) I have included the "Microsoft DTSPackage Object Library" COM reference in the application, but still get an "Invalid Class String" error when the first step of the package is executed. I have also tried registering all the DLLs specified in the redist.txt file of the SQL Server 2000 disc. Any thoughts or suggestions would be greatly appreciated. The DTS package is very simple. It just copies data from the SQL database into Visual FoxPro tables. My code that executes the package is below (much of it is taken from Microsoft's KB article: http://support.microsoft.com/kb/321525).

        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
A: 

If you install the full SQL Enterprise Manager client tools on the user PCs, as a test, can they run it successfully? Maybe you're missing some requirement. Remember that the DTS package itself will be executing locally on the user's PC, not on the server.

dnewton
I installed all the client tools, but still got the same error. I'm using code that, in the past, has worked on client machines without any DLL registration requirements. When I run the app on a machine without any of the DTS DLLs registered, I get another error message: Retrieving the COM class factory for component with CLSID {10020200-EB1C-11CF-AE6E-00AA004A34D5} failed due to the following error: 80040154. After some investigating, it looks like this KB article might provide a solution: http://support.microsoft.com/kb/326909. I'll follow-up after I've tried it. Thanks!
Aaron
A: 

Try to register your DLL with REGASM /CODEBASE

Andre