我被卡住了,试图通过Begintrans和CurrentDB.Execute方法运行更新查询(使用 SQL 连接 2 个表)。运行几秒钟后出现“系统资源超出”错误。
Sub updade_clients()
Dim dbLOCAL_DB As Database
Dim strSQL As String
Dim strWORKSPACE As DAO.WORKSPACE
Set strWORKSPACE = DBEngine.Workspaces(0)
strSQL = "" & _
"UPDATE TBL_IND_CLIENTE_2008_01 INNER JOIN TBL_IND_CLIENTE_2011_01 ON " & _
"TBL_IND_CLIENTE_2008_01.NUMERO = TBL_IND_CLIENTE_2011_01.NUMERO SET " & _
"TBL_IND_CLIENTE_2008.01.CONJUNTO_ELETRICO = [TBL_IND_CLIENTE_2011_01]![CONJUNTO];"
strWORKSPACE.BeginTrans
CurrentDb.Execute strSQL, dbFailOnError
DBEngine.CommitTrans
End Sub
这两个表都有大约 150 万条记录。