And again I get this EXCEPTION_ACCESS_VIOLATION.
Is there anybody who can help me out?
This is the error message:
------------------------------------------------------------------------
Event Type: Error
Event Source: VBRuntime
Event Category: None
Event ID: 1
Date: 16/10/2002
Time: 17:27:22
User: N/A
Computer: BEVVSQL02
Description:
The VB Application identified by the event source logged this Application
GetDiffCustomersPerSKU: Thread ID: 2744 ,Logged: GetDiffCustomersPerSKU.
(1:) SubStep 'DTSStep_DTSDataPumpTask_1' failed with the following error:
Need to run the object to perform this operation
(Microsoft Data Transformation Services (DTS) Package (80040005): Provider
generated code execution exception: EXCEPTION_ACCESS_VIOLATION)
-------------------------------------------------------------------------
I run the package from within a Visual Basic application.
This is the Visual Basic code:
-------------------------------------------------------------------------
Dim WithEvents objPackageEvents As DTS.Package
Private Sub ChangeAllStepsToRunOnMainThread()
Dim i As Integer
#If SwitchTracing Then
Call g_objLogFunctions.WriteToImportLog(PACKAGE_NAME, "In " &
PACKAGE_NAME & ".Worker.ChangeAllStepsToRunOnMainThread()", g_conADO,
EnumLogType.Information)
Call App.LogEvent("In " & PACKAGE_NAME &
".Worker.ChangeAllStepsToRunOnMainThread()")
#End If
For i = 1 To objPackageEvents.Steps.Count
objPackageEvents.Steps(i).ExecuteInMainThread = True
Next i
#If SwitchTracing Then
Call g_objLogFunctions.WriteToImportLog(PACKAGE_NAME, "Out " &
PACKAGE_NAME & ".Worker.ChangeAllStepsToRunOnMainThread()", g_conADO,
EnumLogType.Information)
Call App.LogEvent("Out " & PACKAGE_NAME &
".Worker.ChangeAllStepsToRunOnMainThread()")
#End If
End Sub
Public Function Start() As Long
On Error GoTo Hell
#If SwitchTracing Then
Call App.LogEvent("In " & PACKAGE_NAME & ".Worker.Start()")
#End If
Dim strConnectionString As String
Dim objPackage As DTS.Package2
Dim objStep As DTS.Step
Dim objTask As DTS.Task
Dim objExecPkg As DTS.ExecutePackageTask
Dim comADO As ADODB.Command
Dim strRIMID As String
Dim strDSSServerAddress As String
Dim strDSSDatabaseName As String
Dim strDSSUser As String
Dim strDSSPassword As String
Dim strImportDatabase As String
' Building the connection string
strConnectionString = "Provider=SQLOLEDB.1;Password=" &
g_objSettings.Password _
& ";Persist Security Info=True;User ID=" & g_objSettings.UserID _
& ";Initial Catalog=" & g_objSettings.Database & ";Data Source=" &
g_objSettings.Server
' Make a connection to the database
Call g_objDBFunctions.openConNoCount(g_conADO, strConnectionString)
' Get the RIMID from the database
With g_objUS
Set .Connection = g_conADO
.DatabaseName = g_objSettings.Database
.DBServer = g_objSettings.Server
.UserID = g_objSettings.UserID
strRIMID = .GetRIMIDFromDatabase
End With
' Get the DSS data from the database
Set comADO = New ADODB.Command
With comADO
Set .ActiveConnection = g_conADO
.CommandText = "USP_GetDSSParameters"
.CommandType = adCmdStoredProc
.Parameters.Refresh
.Execute
strDSSServerAddress = .Parameters("@DSSServerAddress")
strDSSDatabaseName = .Parameters("@DSSDatabaseName")
strDSSUser = .Parameters("@DSSUser")
strDSSPassword = .Parameters("@DSSPassword")
strImportDatabase = .Parameters("@ImportDatabase")
End With
#If SwitchTracing Then
Call g_objLogFunctions.WriteToImportLog(PACKAGE_NAME, "In " &
PACKAGE_NAME & ".Worker.Start()", g_conADO, EnumLogType.Information)
#End If
Set g_objSettings = New GetDiffCustomersPerSKU.Settings
Set objPackage = New DTS.Package
Set objPackageEvents = objPackage
objPackage.FailOnError = True
Set objStep = objPackage.Steps.New
Set objTask = objPackage.Tasks.New("DTSExecutePackageTask")
Set objExecPkg = objTask.CustomTask
With objExecPkg
.FileName = App.Path & "\DTS_DSSImport_GetDiffCustomersPerSKU.dts"
.UseTrustedConnection = False
.GlobalVariables("g_strDatabase").Value = g_objSettings.Database
.GlobalVariables("g_stServer").Value = g_objSettings.Server
.GlobalVariables("g_strrDSSServerAddress").Value =
strDSSServerAddress
.GlobalVariables("g_strDSSDatabaseName").Value = strDSSDatabaseName
.GlobalVariables("g_strDSSUser").Value = strDSSUser
.GlobalVariables("g_strDSSPassword").Value = strDSSPassword
.GlobalVariables("g_strImportDatabase").Value = strImportDatabase
.GlobalVariables("g_strRIMID").Value = strRIMID
.Name = "ExecPkgTask"
End With
With objStep
.TaskName = objExecPkg.Name
.Name = "ExecPkgStep"
End With
With objPackage
.Steps.Add objStep
.Tasks.Add objTask
Call ChangeAllStepsToRunOnMainThread
.Execute
End With
Set comADO = Nothing
Set objExecPkg = Nothing
Set objTask = Nothing
Set objStep = Nothing
Set objPackageEvents = Nothing
objPackage.UnInitialize
#If SwitchTracing Then
Call g_objLogFunctions.WriteToImportLog(PACKAGE_NAME, "Out " &
PACKAGE_NAME & ".Worker.Start()", g_conADO, EnumLogType.Information)
Call App.LogEvent("Out " & PACKAGE_NAME & ".Worker.Start()")
#End If
Exit Function
Hell:
Call App.LogEvent(Err.Description)
objPackage.UnInitialize
Start = Err.Number
End Function
Private Sub Class_Initialize()
'Initiate global variables
Set g_conADO = New ADODB.Connection
Set g_objDBFunctions = New RIM_CIM_Common.DBFunctions
Set g_objSettings = New GetDiffCustomersPerSKU.Settings
Set g_objLogFunctions = New RIM_CIM_Common.LogFunctions
Set g_objUS = New RIM_CIM_Common.UserSettings
End Sub
Private Sub Class_Terminate()
'Close connection to the database
If Not g_conADO Is Nothing Then
If Not g_conADO.State = adStateClosed Then
g_conADO.Close
End If
End If
'Destroy all global variables
Set g_conADO = Nothing
Set g_objDBFunctions = Nothing
Set g_objSettings = Nothing
Set g_objLogFunctions = Nothing
Set g_objUS = Nothing
End Sub
Private Sub objPackageEvents_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)
#If SwitchTracing Then
Call App.LogEvent(PACKAGE_NAME & ". " & Description,
vbLogEventTypeError)
Call g_objLogFunctions.WriteToImportLog(PACKAGE_NAME, Description,
g_conADO, Error)
#End If
End Sub
Private Sub objPackageEvents_OnFinish(ByVal EventSource As String)
#If SwitchTracing Then
Call App.LogEvent(PACKAGE_NAME & ". " & "Finished " & EventSource,
vbLogEventTypeInformation)
Call g_objLogFunctions.WriteToImportLog(PACKAGE_NAME, "Finished " &
EventSource, g_conADO, Error)
#End If
End Sub
Private Sub objPackageEvents_OnProgress(ByVal EventSource As String, ByVal
ProgressDescription As String, ByVal PercentComplete As Long, ByVal
ProgressCountLow As Long, ByVal ProgressCountHigh As Long)
#If SwitchTracing Then
Call App.LogEvent(PACKAGE_NAME & ". " & ProgressDescription,
vbLogEventTypeInformation)
Call g_objLogFunctions.WriteToImportLog(PACKAGE_NAME,
ProgressDescription, g_conADO, Error)
#End If
End Sub
Private Sub objPackageEvents_OnQueryCancel(ByVal EventSource As String,
pbCancel As Boolean)
'
End Sub
Private Sub objPackageEvents_OnStart(ByVal EventSource As String)
#If SwitchTracing Then
Call App.LogEvent(PACKAGE_NAME & ". " & "Started " & EventSource,
vbLogEventTypeInformation)
Call g_objLogFunctions.WriteToImportLog(PACKAGE_NAME, "Started " &
EventSource, g_conADO, Error)
#End If
End Sub
ION)