Hi,
I got error message "Error 3035 in ExecuteQry System Resource Exceeded" when I try to execute a query in VBA in Access 2000.
When I double click the query itself, it executes normally.
This is the code:
Option Compare Database
Option Explicit
Private mobjConn As ADODB.Connection
Private mobjCmnd As ADODB.Command
Private Sub ExecuteQry(ByRef ioobjQry As DAO.QueryDef, ByVal pstrQryName As String)
Const METHOD_NAME As String = "ExecuteQry"
On Error GoTo MethodExit
Me.Caption = pstrQryName
Set ioobjQry = CurrentDb.QueryDefs(Replace(pstrQryName, "...", "", , , vbBinaryCompare))
ioobjQry.Execute
DoEvents
MethodExit:
If Err.Number <> 0 Then
MsgBox "Error " & CStr(Err.Number) & " in " & METHOD_NAME & vbCr & Err.Description
End If
End Sub
Private Sub cmdLoadUltimateLosses_Click()
Const METHOD_NAME As String = "cmdLoadUltimateLosses_Click"
On Error GoTo MethodExit
Dim objQry As DAO.QueryDef
Dim strCaption As String
strCaption = Me.Caption
DAO.BeginTrans
ExecuteQry objQry, "00_CleanUpCalculatedFields..."
DAO.CommitTrans
MsgBox "Done"
MethodExit:
Me.Caption = strCaption
If Err.Number <> 0 Then
DAO.Rollback
MsgBox "Error " & CStr(Err.Number) & " in " & METHOD_NAME & vbCr & Err.Description
End If
End Sub
Private Sub ConnectDB(ByRef ioobjConn As ADODB.Connection, _
ByRef ioobjCmnd As ADODB.Command)
Const METHOD_NAME As String = "ConnectDB"
Dim objDB As Database
On Error GoTo MethodExit
Set ioobjConn = New ADODB.Connection
Set ioobjCmnd = New ADODB.Command
Set objDB = CurrentDb
With ioobjConn
.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};Dbq=" & objDB.Name & ";Exclusive=0"
.CursorLocation = ADODB.adUseClient
.Open
End With
Set ioobjCmnd.ActiveConnection = ioobjConn
MethodExit:
If Err.Number <> 0 Then
MsgBox "Error " & CStr(Err.Number) & " in " & METHOD_NAME & vbCr & Err.Description
End If
End Sub
Private Sub cmdConnect_Click()
ConnectDB mobjConn, mobjCmnd
MsgBox "Connected!"
End Sub
This is the 00_CleanUpCalculatedFields query:
UPDATE LossTrend SET LossTrend.TotalUltimateLosses = 0, LossTrend.CappedUltimateLosses = 0, LossTrend.TotalUltimateLossesExCats = 0, LossTrend.CappedUltimateLossesExCats = 0, LossTrend.UltimateClaimCount = 0, LossTrend.UltimateClaimCountExCats = 0, LossTrend.Cap = 0;
The LossTrend table contains 154130 records, 35 fields. The fields that updated are numerical, double mostly.
Could somebody help me with this issue?
Thank you!
vladk
I got error message "Error 3035 in ExecuteQry System Resource Exceeded" when I try to execute a query in VBA in Access 2000.
When I double click the query itself, it executes normally.
This is the code:
Option Compare Database
Option Explicit
Private mobjConn As ADODB.Connection
Private mobjCmnd As ADODB.Command
Private Sub ExecuteQry(ByRef ioobjQry As DAO.QueryDef, ByVal pstrQryName As String)
Const METHOD_NAME As String = "ExecuteQry"
On Error GoTo MethodExit
Me.Caption = pstrQryName
Set ioobjQry = CurrentDb.QueryDefs(Replace(pstrQryName, "...", "", , , vbBinaryCompare))
ioobjQry.Execute
DoEvents
MethodExit:
If Err.Number <> 0 Then
MsgBox "Error " & CStr(Err.Number) & " in " & METHOD_NAME & vbCr & Err.Description
End If
End Sub
Private Sub cmdLoadUltimateLosses_Click()
Const METHOD_NAME As String = "cmdLoadUltimateLosses_Click"
On Error GoTo MethodExit
Dim objQry As DAO.QueryDef
Dim strCaption As String
strCaption = Me.Caption
DAO.BeginTrans
ExecuteQry objQry, "00_CleanUpCalculatedFields..."
DAO.CommitTrans
MsgBox "Done"
MethodExit:
Me.Caption = strCaption
If Err.Number <> 0 Then
DAO.Rollback
MsgBox "Error " & CStr(Err.Number) & " in " & METHOD_NAME & vbCr & Err.Description
End If
End Sub
Private Sub ConnectDB(ByRef ioobjConn As ADODB.Connection, _
ByRef ioobjCmnd As ADODB.Command)
Const METHOD_NAME As String = "ConnectDB"
Dim objDB As Database
On Error GoTo MethodExit
Set ioobjConn = New ADODB.Connection
Set ioobjCmnd = New ADODB.Command
Set objDB = CurrentDb
With ioobjConn
.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};Dbq=" & objDB.Name & ";Exclusive=0"
.CursorLocation = ADODB.adUseClient
.Open
End With
Set ioobjCmnd.ActiveConnection = ioobjConn
MethodExit:
If Err.Number <> 0 Then
MsgBox "Error " & CStr(Err.Number) & " in " & METHOD_NAME & vbCr & Err.Description
End If
End Sub
Private Sub cmdConnect_Click()
ConnectDB mobjConn, mobjCmnd
MsgBox "Connected!"
End Sub
This is the 00_CleanUpCalculatedFields query:
UPDATE LossTrend SET LossTrend.TotalUltimateLosses = 0, LossTrend.CappedUltimateLosses = 0, LossTrend.TotalUltimateLossesExCats = 0, LossTrend.CappedUltimateLossesExCats = 0, LossTrend.UltimateClaimCount = 0, LossTrend.UltimateClaimCountExCats = 0, LossTrend.Cap = 0;
The LossTrend table contains 154130 records, 35 fields. The fields that updated are numerical, double mostly.
Could somebody help me with this issue?
Thank you!
vladk