Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server DTS
|
SQL Server DTS Discussion specific to Data Transformation Service with SQL Server. General SQL Server discussions should use the general SQL Server forum. Readers of the book Professional SQL Server 2000 DTS with questions specific to that book should post in that book forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server DTS section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 18th, 2003, 04:59 PM
Registered User
 
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default DTS packages from VB 6 to VB .NET

I have read many articles to try to fix an error that I am having after converting a DTS packages that was save in VB 6 and later converted into VB .NET

On one article that I read it said that I need it to get SQL Server service Pack 3 for the server and also Service Pack 3 for desktop.
After doing all that I am still having the same problem. I have been struggling with this for quite a while. I am going to post more code to see if it help:



System.InvalidCastException has ocurred at XXXXXX.exe
Specifically in the code at:
oCustomTask1 = oTask.CustomTask
QueryInterface for interface DTS.CustomTask failed

On one article that I read it said that I need it to get SQL Server service Pack 3 for the server and also Service Pack 3 for desktop.
After doing all that I am still having the same problem. I have been struggling with this for quite a while. I am going to post more code to see if it help:

Public Sub Task_Sub1(ByVal goPackage As DTS.Package2)
        Dim DTS As Object

        Dim oTask As DTS.Task
        Dim oLookup As DTS.Lookup
        Dim oCustomTask1 As DTS.DataPumpTask2
        oTask = goPackage.Tasks.New("DTSDataPumpTask")
        oCustomTask1 = oTask.CustomTask (ERROR)


        oCustomTask1.Name = "Copy Data from BOL_CLEVELAND_FINAL to [Marketing].[dbo].[BOL_CLEVELAND_FINAL1] Task"
        oCustomTask1.Description = "Copy Data from FINAL to [Mark].[dbo].[FINAL1] Task"
        oCustomTask1.SourceConnectionID = 1
        oCustomTask1.SourceSQLStatement = "select `Field5`,`Field2`,`ACCOUNT,`INDEX` from `FINAL`"
        oCustomTask1.DestinationConnectionID = 2
        oCustomTask1.DestinationObjectName = "[Mark].[dbo].[FINAL1]"
        oCustomTask1.ProgressRowCount = 1000
        oCustomTask1.MaximumErrorCount = 0
        oCustomTask1.FetchBufferSize = 1
        oCustomTask1.UseFastLoad = True
        oCustomTask1.InsertCommitSize = 0
        oCustomTask1.ExceptionFileColumnDelimiter = "|"
        oCustomTask1.ExceptionFileRowDelimiter = vbCrLf
        oCustomTask1.AllowIdentityInserts = False
        oCustomTask1.FirstRow = 0
        oCustomTask1.LastRow = 0
        oCustomTask1.FastLoadOptions = 2
        oCustomTask1.ExceptionFileOptions = 1
        oCustomTask1.DataPumpOptions = 0

        Call oCustomTask1_Trans_Sub1(oCustomTask1)
        goPackage.Tasks.Add(oTask)
         oCustomTask1 = Nothing
                oTask = Nothing

    End Sub







Similar Threads
Thread Thread Starter Forum Replies Last Post
DTS and VB.net ninel SQL Server DTS 0 August 18th, 2005 08:32 AM
dts and vb.net collie SQL Server DTS 1 November 27th, 2004 10:13 AM
Executing DTS packages in ASP.NET bmains SQL Server DTS 2 March 17th, 2004 03:50 PM
converting DTS package from VB 6 to VB .NET petroleo Pro VB Databases 0 August 18th, 2003 05:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.