Mega Code Archive

 
Categories / Delphi / ADO Database
 

Increasing Database Applications Performance

Title: Increasing Database Applications Performance Question: Using Disable Controls. Answer: Disable controls method of dataset can reduce the processing time when you have to do some mass operation on a table/query. How it works? Simply. table1.disablecontrols; //your code here like: //table1.first; //while not table1.eof do // begin // table1.fields[1].asstring:='A value'; // table1.next; // end; table1.enablecontrols; Inside the bloc disablecontrols enablecontrols, the operations are executed directly on your dataset, without changing dbaware controls (like dbgrid). After EnabledControls, the changes will be reflected on your dbaware components. Note: A better code snippet is: try table1.disablecontrols; //your code here finally table1.enablecontrols; end; You know why is better...