下面是个简单易学的如何优化Access数据库教程,图老师小编详细图解介绍包你轻松学会,喜欢的朋友赶紧get起来吧!
【 tulaoshi.com - 编程语言 】
How to speed up database access
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)Here is a trick to loop through a recordset faster. Often when looping through a recordset people will use the following code:
Do While Not Records.EOF
Combo1.AddItem Records![Full Name]
Eecords.Movenext
LoopThe problem is that everytime the database moves to the next record it must make a check to see if it has reached the end of the file. This slows the looping down a great deal. When moving or searching throuch a large record set this can make a major difference. Here is a better way to do it.
Records.MoveLast
intRecCount=Records.RecordCount
Records.MoveFirst
For intCounter=1 To intRecCount
Combo1.AddItem Records![Full Name]
Records.MoveNext
Next intCounterYou should see about a 33% speed increase.
来源:http://www.tulaoshi.com/n/20160219/1604474.html
看过《如何优化Access数据库》的人还看了以下文章 更多>>