Hi all,
I am successfully executing a DTS package from a VB app on the
development workstation, but having issues when trying to execute from
another client workstation...
The DTS connects to an .xls table, drops an existing SQLServer2000
table, creates a new (copy) SQL table, then finally populates the table
from the .xls file.
This same exact process works just fine for another set of SQLServer
Tables and .xls files on a network file server, but for some unknown
reason this one fails.
No errors are raised, but what happens after the process runs is that
the table gets dropped (as it's supposed to), then re-created (as it's
supposed to). But NO data is inserted from the originating .xls table.
Any insight/comments are greatly appreciated.
james
VB Code:
Public Function RunChickenPackage()
'Run the package stored in file C:\DTS_UE\TestPkg\VarPubsFields.dts.
Dim objPackage As DTS.Package2
Dim objStep As DTS.Step
Dim objTask As DTS.Task
Dim objExecPkg As DTS.ExecutePackageTask
'On Error GoTo PackageError
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 = "user"
.FileName = "H:\Shared\GIS\AO_VCMS\db\MonitoringPositives.dts"
.Name = "ExecPkgTask"
End With
With objStep
.TaskName = objExecPkg.Name
.Name = "ExecPkgStep"
.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
End Function
Sorry -- wrong forum... This posting has been moved to the DTS group.
j
Friday, March 9, 2012
Run DTS from VB app (problems..)
Labels:
app,
database,
dts,
execute,
executing,
fromanother,
microsoft,
mysql,
oracle,
package,
run,
server,
sql,
successfully,
thedevelopment,
workstation
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment