Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DTS Event handler in VB returns Execution Cancelled
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Title:
DTS Event handler in VB returns Execution Cancelled
Miscellaneous
Thread ID:
00720519
Message ID:
00720519
Views:
51
Hello,
I have created a VB app that handles DTS events. I am using Package object WITHEVENTS and not Package2 object (just as MSDN explains it).

I have not coded anything in the OnQueryCancel event, however, I have dummy statments in that even (again MSDN says I have to otherwise there is an error).


However, intermittantly, I get an "Execution Cancelled by User" error.

Can anyone tell me why ?


Public WithEvents X As DTS.Package

Private Sub cmdRun_Click()
Dim oDTS As New DTS.Package2
oDTS.LoadFromStorageFile Text1.Text, ""

Set X = oDTS
For i = 1 To X.Steps.Count
X.Steps(i).ExecuteInMainThread = True '' MSDN says I should do this
mySteps.AddNew
mySteps!StepName = X.Steps(i).Name
mySteps!PercentComplete = 0
mySteps.Update
Next

DoEvents
X.Execute
X.UnInitialize
end sub


Private Sub x_OnQueryCancel(ByVal EventSource As String, pbCancel As Boolean)
Exit Sub
End Sub
Private Sub x_OnStart(ByVal EventSource As String)
Exit Sub
End Sub

Private Sub x_OnProgress(ByVal EventSource As String, ByVal ProgressDescription As
String, ByVal PercentComplete As Long, ByVal ProgressCountLow As Long, ByVal ProgressCountHigh As Long)
Exit Sub
End Sub

Private Sub X_OnFinish(ByVal EventSource As String)
Exit Sub
End Sub

Private Sub x_OnError(ByVal EventSource As String, ByVal ErrorCode As Long, ByVal Source As String, ByVal Description As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal IDofInterfaceWithError As String, pbCancel As Boolean)
Exit Sub
End Sub
Bharat Sanghvi
Vice President, Information Technology
Deyta
Continuous Quality Measurement Systems
Reply
Map
View

Click here to load this message in the networking platform