Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to accelerate database searches Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
accelerate database searches 25-Aug-02
Category
DB-General
Language
Delphi 2.x
Views
93
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas 

How to accelerate database searches

Answer:

Do you want a simple, one-line method for speeding up your database searches? After 
you know what your search target is but before beginning your search, disable the 
search table with the DisableControls method. This effectively disconnects the 
DataSet from the DataSource component. For example:

1   unit Unit1;
2   
3   type
4     TForm1 = class(TForm)
5       DataSource1: TDataSource;
6       Table1: TTable;
7       Button1: TButton;
8   
9       procedure TForm1.Button1Click(Sender: TObject);
10    var
11      SeekValue: string;
12      begin
13        Table1.DisableControls;
14        Table1.FindKey([SeekValue]);
15        Table1.EnableConstraints;
16      end;
17  
18    end.


As the search advances through an index, using the Next method, data aware components attached to the dataset are updated. The speed increase results from severing the connection, avoiding the component updates and restoring the connection when the search is completed.

			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC