点击这里给我发消息 点击这里给我发消息
首页 > 行业资讯 > Access>详细内容

如何优化Access数据库

添加时间:2010-6-22
    相关阅读: 数据库 Access 优化

How to speed up database access

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.

本文作者:
咨询热线:020-85648757 85648755 85648616 0755-27912581 客服:020-85648756 0755-27912581 业务传真:020-32579052
广州市网景网络科技有限公司 Copyright◎2003-2008 Veelink.com. All Rights Reserved.
广州商务地址:广东省广州市黄埔大道中203号(海景园区)海景花园C栋501室
= 深圳商务地址:深圳市宝源路华丰宝源大厦606
研发中心:广东广州市天河软件园海景园区 粤ICP备05103322号 工商注册