我在一个事务中执行一个简单的UPDATE tblTable SET DataSet=3
,但是在尝试运行它之后几秒钟,我得到了一个3035 - 超出了系统资源。有大约30K行。
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
知道为什么会这样,以及如何避免它。
答案 0 :(得分:0)
似乎你正在更新整个表,即没有where条件,你确定你想要更新整个表,如果你在循环中更新整个表(我没有在你的代码中看到循环,你仍然可以在循环中调用此过程)系统很有可能出现此错误。