且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用链接表访问连续表单-如何避免为表单中的每一行击中数据库服务器?

更新时间:2023-11-12 08:50:04

原来的问题是两个聚合字段.一个字段的控制源为= Count(ID),另一字段的控制源为= Sum(Total_Qty).

Turned out the problem was two aggregate fields. One field's Control Source was =Count(ID) and the other field's Control Source was =Sum(Total_Qty).

清除这两个字段的控制源可以使表单快速打开.如Gord Thompson所述,SQL Server Profiler显示它调用sp_execute一次检索7个批处理,每批10行.比一次进行2000次调用来一次检索一行要快得多.

Clearing the control sources of those two fields allowed the form to open quickly. SQL Server Profiler shows it calling sp_execute, as Gord Thompson described, to retrieve seven batches of 10 rows at a time. Much quicker than making 2000 calls to retrieve one row at a time.