October 24, 2002 at 11:19 am
I've got a strange problem here with my VB6 app. that
I've added a DTS section to. In the VB dev. env. when I
run the application the first time, I get a "Run-Time
Error -2147220440 (80040428); Package failed because Step
xxxxx Failed". It's abending with the first of 3 steps in
the package. In the VB program when I go into debug it's
stopped at the 'pkg.execute' line. Now, if I 'step-thru'
the rest of the code it successfully executes all 3 of
the steps. If I run the application a second or
subsequent times without closing it down and reopening
the dev. env. it runs without any errors. This is just
too weired but it seems like there must be some type of
initialization problem. I'm using 3 global variables, and
these get set prior to the 'execute' statement. I've
included the code below. Since this is my first vb/dts
application maybe I've missed something. Any IDEAS
anyone???
Thanks...
Private Sub mnuImportROCLoans_Click()
Dim oPKG As DTS.Package
Dim oStep As DTS.Step
Dim ogv As DTS.GlobalVariable
Dim sPKGName, smsg, sDesc As String
Dim sSource As String
Dim sVBResponse As String
Dim lErr As Long
frmChooseCustomer.Show 1
frmChooseContent.Show 1
sVBResponse = MsgBox("Has the 'Range Name' been set
for WorkSheet1 in the LoadMaster file?", _
vbYesNo + vbDefaultButton2 + vbQuestion, "CHECK
RANGE NAME SETTING")
If sVBResponse = vbNo Then
Exit Sub
End If
Set oPKG = New DTS.Package
sPKGName = "RBMG LOAD"
oPKG.LoadFromSQLServer gsDS, gsUserID, gsPassWord, _
DTSSQLStgFlag_Default, , , , sPKGName
For Each oStep In oPKG.Steps
oStep.ExecuteInMainThread = True
Next
oPKG.GlobalVariables.Item("gvCustomerID").Value =
frmChooseCustomer.iparmCustomerID
oPKG.GlobalVariables.Item("gvContentType").Value =
frmChooseContent.iparmContentType
oPKG.GlobalVariables.Item("gvWorkArea").Value =
gsWorkArea
For Each ogv In oPKG.GlobalVariables
Debug.Print ogv.Name, ogv.Value
Next
oPKG.Execute
For Each oStep In oPKG.Steps
If oStep.ExecutionResult =
DTSStepExecResult_Failure Then
oStep.GetExecutionErrorInfo lErr, sSource,
sDesc
smsg = smsg & "Step """ & oStep.Description &
_
""" Failed" & vbCrLf & _
vbTab & "Error: " & lErr & vbCrLf & _
vbTab & "Source: " & sSource & vbCrLf & _
vbTab & "Description: " & sDesc & vbCrLf
& vbCrLf
Else
smsg = smsg & "Step: """ & oStep.Description
& _
""" Succeeded" & vbCrLf & vbCrLf
End If
Next
oPKG.UnInitialize
Set ogv = Nothing
Set oStep = Nothing
Set oPKG = Nothing
MsgBox smsg
End Sub
October 28, 2002 at 6:31 pm
This was removed by the editor as SPAM
October 28, 2002 at 6:34 pm
I ran into a similar issue doing a file import, first time I would get a collation error, but if I did a resume it worked fine. Documented bug in that instance.
Andy
October 29, 2002 at 8:39 am
thanks for the reply Andy, now here's where it gets even stranger. I decided to compile the app and see what the executable would do. Guess what, the executable runs without any error condition. Good enough for me..
October 29, 2002 at 10:14 am
Isn't this login or security error?
Perhaps you are expecting something to be created or loaded that happens when the rest of the steps run?
Steve Jones
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply