EXCEPTION_ACCESS_VIOLATION Part II

EXCEPTION_ACCESS_VIOLATION Part II

Post by Nico Debeuckelaer » Fri, 18 Oct 2002 17:21:19



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)

 
 
 

EXCEPTION_ACCESS_VIOLATION Part II

Post by Gert E.R. Draper » Fri, 18 Oct 2002 16:46:35


No sure yet about the reason for the AV, but your event implementation is
missing an assignment of the pbCancel parameters in the OnError and
OnQueryCancel event.
This is a Boolean passed in by ref, to indicate if you want to continue or
not. You need to set these to False if you want to continue processing once
the event fires. You should never rely on the default value, so add pbCancel
= False to both events.

Ge...@SQLDev.Net

Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright ? SQLDev.Net 1991-2002 All rights reserved.

"Nico Debeuckelaere" <n...@nd-sign.com> wrote in message

news:#qCwE4adCHA.1704@tkmsftngp10...
> 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)


 
 
 

EXCEPTION_ACCESS_VIOLATION Part II

Post by Nico Debeuckelaer » Fri, 18 Oct 2002 18:26:53


I did this but I still get the same error.

"Gert E.R. Drapers" <Ge...@SQLDev.Net> wrote in message
news:#IYdkEbdCHA.1948@tkmsftngp09...

> No sure yet about the reason for the AV, but your event implementation is
> missing an assignment of the pbCancel parameters in the OnError and
> OnQueryCancel event.
> This is a Boolean passed in by ref, to indicate if you want to continue or
> not. You need to set these to False if you want to continue processing
once
> the event fires. You should never rely on the default value, so add
pbCancel
> = False to both events.

> Ge...@SQLDev.Net

> Please reply only to the newsgroups.
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> You assume all risk for your use.
> Copyright ? SQLDev.Net 1991-2002 All rights reserved.

> "Nico Debeuckelaere" <n...@nd-sign.com> wrote in message
> news:#qCwE4adCHA.1704@tkmsftngp10...
> > 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"

- Show quoted text -

> >         .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)

 
 
 

EXCEPTION_ACCESS_VIOLATION Part II

Post by Gert E.R. Draper » Sat, 19 Oct 2002 00:02:46


I did not expect that would be the problem, I just wanted to point it out,
otherwise you would get an message like "Execution cancelled by user" or
something like that.
You can email me the package and I can look at it? Would it be possible to
run it outside your environment?

Ge...@SQLDev.Net

Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright ? SQLDev.Net 1991-2002 All rights reserved.

"Nico Debeuckelaere" <n...@nd-sign.com> wrote in message

news:e61CucbdCHA.1476@tkmsftngp10...
> I did this but I still get the same error.

> "Gert E.R. Drapers" <Ge...@SQLDev.Net> wrote in message
> news:#IYdkEbdCHA.1948@tkmsftngp09...
> > No sure yet about the reason for the AV, but your event implementation
is
> > missing an assignment of the pbCancel parameters in the OnError and
> > OnQueryCancel event.
> > This is a Boolean passed in by ref, to indicate if you want to continue
or
> > not. You need to set these to False if you want to continue processing
> once
> > the event fires. You should never rely on the default value, so add
> pbCancel
> > = False to both events.

> > Ge...@SQLDev.Net

> > Please reply only to the newsgroups.
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > You assume all risk for your use.
> > Copyright ? SQLDev.Net 1991-2002 All rights reserved.

> > "Nico Debeuckelaere" <n...@nd-sign.com> wrote in message
> > news:#qCwE4adCHA.1704@tkmsftngp10...
> > > 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.

- Show quoted text -

> > > (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)

- Show quoted text -

> > > '   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

- Show quoted text -

> > >         .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

...

read more »

 
 
 

EXCEPTION_ACCESS_VIOLATION Part II

Post by Allan Mitchel » Sat, 19 Oct 2002 03:07:04


Have you had a look at this KB article

FIX: DTSTransferObjects with Events Generates an Error Message
and an Access Violation in Visual Basic Q316331

--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE, MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community for SQL Server
professionals - http://www.sqlpass.org

 
 
 

1. Need Help on SQL Server 6.5 - Part II

Ted and Jerry:
Thanks for your reply.  It somewhat helped me.  At least I was able to run the command, but still have problems....

Let me start saying that I am not a SQL Server person.  I can run queries against them, but never loaded or worked with SQL Server or any other database before as far as "DBA Roles" go.

With that said, Let's get back to the problem... I wnt to the Dos prompt and typed the command
E:\MSSQL\BINN\bcp MMAC..tblMMAC in tblMMAC.txt \c \Usa \P

At least I saw the command running.  Thanks to you guys.  But I got the following error
DB-Library Error:
        Attempt to bulk-copy an oversized row to the SQL Server

It printed that row for every record I attempted to copy (345 records).  Then at the end it says "345 rows copied".  I assumed that some truncation occured in the process, but I went back to ISWL/w and ran

SELECT * from tblMMAC
GO

and got 0 rows.

So, I can assume that the problem is somewhere else.

This is what I have done so far:
- Checked rights for user to load table.  Everything looks in order.
- Checked at the database level if the "Bulk Copy/Insert Into" flag was checked, and it was.
-The columns of both tables are all char fields, except the key field in access table is an autonumber and in SQL Server table it int(4) identity.  Also a Date/time fieldin access (Long date) I named it as char(255).

Don't know what else to do with this.  Any suggestions on things I should be looking for?
Any other way to load the data to the table?

Just remember that I'm a novice at this, so please be very explicit on you comments.


Thanks.

2. Boston..Oracle DBA Needed

3. Advanced MDX Question: Filter on Member Property Part II

4. External Procedures at Windows NT Oracle 8

5. Group sometimes, part II

6. Slow Query Analyzer

7. Stored Procedure Query Too Slow Part II

8. Looking for a programmable DB ...

9. Selecting counts based on min Part II

10. Help needed on creating SQL-statement (part II)

11. Trigger Problems Part II

12. Using Delete and wanting unlogged PART II

13. Considering SQL Server 2000 part II