Execute
Previous  Top  Next

See Also Properties Methods Events Example
Unit
MySQLDataset

Applies to
TMySQLDataset TMySQLTable and TMySQLQuery components

Declaration
procedure Execute(const WaitFor: boolean=False);

Description
This method is to be used instead of a normal Open, or Active := True, to open the dataset. The difference is, if you use this method it will open the dataset in a seperate thread from your main application. You main application will thus not pause until this dataset has opened, but will function normally. You can test this dataset's State=dsBrowse property to test when it has finished opening. If WaitFor is True, your main application thread will wait for the seperate thread to finish before continuing execution. If False, your pass this method in a split second and continue functioning normally. Also see doThreadedUpdates in Options.

Usually when thread opening a dataset a developer would at least like to know when has opened in order to activate dependent data-aware components etc. For this purpose the dataset publishes the OnThreadOpened and OnThreadPosted events.