Solved

How to stop dbgrid to redraw while loading data

Posted on 1998-04-10
3
215 Views
Last Modified: 2012-05-04
In my application I load about 1000 records in a table which is connected to a DBGrid. How can I control the redrawing of the DBGrid during the load process? I would like to stop the redraw temporarily to speed things up.
0
Comment
Question by:hansbos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 100 total points
ID: 1460905
Use the LockWindowUpdate API:
Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long

'Lock:
LockWindowupdate db1.hwnd

'unlock
LockWindowUpdate 0
0
 

Author Comment

by:hansbos
ID: 1460906
Thanks. It works perfectly.
0
 

Author Comment

by:hansbos
ID: 1460907
Thanks. It works perfectly.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month6 days, 9 hours left to enroll

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question