DAO.Recordset性能 [英] DAO.Recordset performance
本文介绍了DAO.Recordset性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我要打开表或查询的DAO.recordset
If I am going to open a DAO.recordset of a table or a query
会做类似的事情
Set rs = CurrentDb.OpenRecordset("dbo_Some_Table", dbOpenDynaset, dbSeeChanges)
然后快
Set rs = CurrentDb.TableDefs("dbo_Some_Table").OpenRecordset(dbOpenDynaset, dbSeeChanges)
或
Set rs = CurrentDb.QueryDefs("qrySomeQuery").OpenRecordset(dbOpenDynaset, dbSeeChanges)
或者没有区别,只是偏好。
Or is there no difference, just preference.
推荐答案
尝试使用它来测试时间差异
Try using this to test the timing difference
Dim StartTime As Double
Dim SecondsElapsed As Double
StartTime = Timer
并在模块末尾
SecondsElapsed = Round(Timer - StartTime, 2)
MsgBox "This code ran successfully in " & SecondsElapsed & " seconds", vbInformation
我实际上只运行了一次,这里是结果。该查询是我上面使用的同一张表中的SELECT *。我选了一张我知道也有大约100万条记录的表,所以希望这对您有帮助吗?抱歉,昨天我没听懂,某些报告功能坏了,我不得不修复它们。
I actually just ran each and here are the results. The query is a SELECT * from the same table i use above. I picked a table I know has about 1 million records too, so hopefully this helps? Sorry I didnt get to this yesterday, some reporting features broke and i had to fix them.
这篇关于DAO.Recordset性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文