System Resources Exceeded whilst performing UPDATE SQL in Access inside Transaction

心已入冬 提交于 2019-12-24 05:00:11

问题


I'm performing a simple UPDATE tblTable SET DataSet=3 inside a transaction, but a few seconds after trying to run it, I get a 3035 - System Resources exceeded. There are ~30K rows.

Dim db As DAO.Database, wrk As DAO.Workspace, errCount As Long, stSQL As String

Set db = CurrentDb
Set wrk = DBEngine.Workspaces(0)
errCount = 0
wrk.BeginTrans
    Debug.Print "There are no existing entries in the selected DataSet, preparing to proceed..."
    ' - -- ---
    stSQL = "UPDATE tblImportCleaned SET DataSetID=" & Me.lstDataSets
    db.Execute stSQL, dbSeeChanges
    If db.RecordsAffected < 1 Then errCount = errCount + 1
    Me.frmImport_CleanedSubform.Requery
    ' - -- ---

If errCount = 0 Then
    If MsgBox("There were no errors, would you like to COMMIT the changes?", vbYesNo) = vbYes Then
        wrk.CommitTrans
    Else
        wrk.Rollback
    End If
Else
    wrk.Rollback
End If
wrk.Close

Any idea why this is happening and how I can avoid it please.


回答1:


It seems to be you are updating entire table i.e without where condition, are you sure you want to update entire table and if you are updating entire table in a loop (i don't see loop in you code, still you may be calling this procedure in a loop) system has high possibility of getting this error.



来源:https://stackoverflow.com/questions/12218256/system-resources-exceeded-whilst-performing-update-sql-in-access-inside-transact

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!