dbTalk Databases Forums  

Problem running DTS package - not performing table updates

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Problem running DTS package - not performing table updates in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Debi Brown
 
Posts: n/a

Default Problem running DTS package - not performing table updates - 01-06-2005 , 05:47 AM






I'm having a problem running a DTS package in VB. Everthing works fine on our
development PC but when we install on our test PC the package seems to run
(ie we're not getting an error message) but doesn't transfer the data to the
table in SQL Server 2000.

I've tried both calling the DTS package on the server using:

Dim objPackage As New DTS.Package

objPackage.LoadFromSQLServer _
ServerName:="test_server", _
ServerUserName:="******", _
ServerPassword:="******", _
PackageName:="ImportCSV"
objPackage.Execute

objPackage.UnInitialize

and calling the *.dts package in the application directory using:

Dim objPackage As DTS.Package2
Dim objStep As DTS.Step
Dim objTask As DTS.Task
Dim objExecPkg As DTS.ExecutePackageTask

Set objPackage = New DTS.Package
Set mobjPkgEvents = objPackage
objPackage.FailOnError = True

'Create the step and task. Specify the package to be run, and link the step
to the task.
Set objStep = objPackage.Steps.New
Set objTask = objPackage.Tasks.New("DTSExecutePackageTask")
Set objExecPkg = objTask.CustomTask

With objExecPkg
..PackagePassword = ""
..FileName = App.Path & "\ImportCSV.dts"
..Name = "ImportCSV"
End With

With objStep
..TaskName = objExecPkg.Name
..Name = "ImportCSV"
..ExecuteInMainThread = True
End With
objPackage.Steps.Add objStep
objPackage.Tasks.Add objTask

'Run the package and release references.
objPackage.Execute

Set objExecPkg = Nothing
Set objTask = Nothing
Set objStep = Nothing
Set mobjPkgEvents = Nothing

objPackage.UnInitialize

but neither seems to work on our test PC.

Any thoughts on what we're missing would be appreciated.
TIA
Debi



Reply With Quote
  #2  
Old   
alaspin
 
Posts: n/a

Default RE: Problem running DTS package - not performing table updates - 01-06-2005 , 09:09 AM






Hi Debi,

http://support.microsoft.com/default...b;en-us;321525

There probably IS an error but it is being exposed correctly. Have a look at
this article, which talks about VB.NET - the problem was around with VB6.0 (I
think) and there may be a similar article using VB6.0 should this one not
help you...

Essentially you need to add the VB class code they give in order to trap the
events raised INSIDE the package as it executes. I have found this additional
error reporting extremely handy in the past.

HTH

alaspin (AT) yahoo (DOT) com

"Debi Brown" wrote:

Quote:
I'm having a problem running a DTS package in VB. Everthing works fine on our
development PC but when we install on our test PC the package seems to run
(ie we're not getting an error message) but doesn't transfer the data to the
table in SQL Server 2000.

I've tried both calling the DTS package on the server using:

Dim objPackage As New DTS.Package

objPackage.LoadFromSQLServer _
ServerName:="test_server", _
ServerUserName:="******", _
ServerPassword:="******", _
PackageName:="ImportCSV"
objPackage.Execute

objPackage.UnInitialize

and calling the *.dts package in the application directory using:

Dim objPackage As DTS.Package2
Dim objStep As DTS.Step
Dim objTask As DTS.Task
Dim objExecPkg As DTS.ExecutePackageTask

Set objPackage = New DTS.Package
Set mobjPkgEvents = objPackage
objPackage.FailOnError = True

'Create the step and task. Specify the package to be run, and link the step
to the task.
Set objStep = objPackage.Steps.New
Set objTask = objPackage.Tasks.New("DTSExecutePackageTask")
Set objExecPkg = objTask.CustomTask

With objExecPkg
.PackagePassword = ""
.FileName = App.Path & "\ImportCSV.dts"
.Name = "ImportCSV"
End With

With objStep
.TaskName = objExecPkg.Name
.Name = "ImportCSV"
.ExecuteInMainThread = True
End With
objPackage.Steps.Add objStep
objPackage.Tasks.Add objTask

'Run the package and release references.
objPackage.Execute

Set objExecPkg = Nothing
Set objTask = Nothing
Set objStep = Nothing
Set mobjPkgEvents = Nothing

objPackage.UnInitialize

but neither seems to work on our test PC.

Any thoughts on what we're missing would be appreciated.
TIA
Debi



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.