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 November 10th, 2005, 10:43 AM
Authorized User
 
Join Date: Dec 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default DTS Fails when called from VB

I'm trying to call a DTS package(SQL 2000) from VB(6.0) but I'm getting permission errors on the tables I'm trying to perform operations on (even though I've granted the public user complete access to this tables). The DTA package is on a remote server, the code is running on a local machine.

Here is the code I'm using to try to run the package:
Dim oPKG As DTS.Package, oStep As DTS.Step
Dim sPackageName As String, sMessage As String
Dim lErr As Long, sSource As String, sDesc As String

    Set oPKG = New DTS.Package

    oPKG.LoadFromSQLServer "RSLNY2-0161", "", "", _
        "256", , , , "VoughtExtract"
' oPKG.Execute

     ' Set Exec on Main Thread
    For Each oStep In oPKG.Steps
        oStep.ExecuteInMainThread = True
    Next

' Execute
    oPKG.Execute

    ' Get Status and Error Message
    For Each oStep In oPKG.Steps
        If oStep.ExecutionResult = DTSStepExecResult_Failure Then
            oStep.GetExecutionErrorInfo lErr, sSource, sDesc
            sMessage = sMessage & "Step """ & oStep.Name & _
                """ Failed" & vbCrLf & _
                vbTab & "Error: " & lErr & vbCrLf & _
                vbTab & "Source: " & sSource & vbCrLf & _
                vbTab & "Description: " & sDesc & vbCrLf & vbCrLf
        Else
            sMessage = sMessage & "Step """ & oStep.Name & _
                """ Succeeded" & vbCrLf & vbCrLf
        End If
    Next


    oPKG.UnInitialize
    Set oPKG = Nothing
    Set oStep = Nothing


This package does work when I run it via SQL Enterprise Manager.

Any help in getting this to work would be most appreciated.
 
Old November 10th, 2005, 02:05 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Did you try supplying a SQL Server User ID and Password when loading the package?

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
DTS Package Fails When Scheduled kwilliams SQL Server DTS 4 December 23rd, 2005 02:47 PM
DTS package fails: [DBNETLIB]..... rrhandle SQL Server DTS 0 May 19th, 2005 07:29 PM
DTS Package Neither Succeeds Nor Fails Crowandazi SQL Server DTS 1 March 21st, 2005 11:27 PM
DTS Schedule import data fails ppenn SQL Server 2000 4 November 5th, 2003 06:48 AM
DTS Export Wizard (SQL to Access 2000) fails ctudose SQL Server 2000 2 June 13th, 2003 05:46 AM





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