I've not used TQuery so I can't say exactly what is happening. According to my notes, there are five steps to using query at design time:
1[tab]Place a query component from the Data Access tab of the Component palette in a data module, and set its Name property appropriately for your application.
2[tab]Set the DatabaseName property of the component to the name of the database to query. DatabaseName can be a BDE alias, an explicit directory path (for local tables), or the value from the DatabaseName property of a TDatabase component in the application.
3[tab]Specify an SQL statement in the SQL property of the component, and optionally specify any parameters for the statement in the Params property. For more information, see "Specifying the SQL property" at design time in your help file.
4[tab]If the query data is to be used with visual data controls, place a data source component from the Data Access tab of the Component palette in the data module, and set its DataSet property to the name of the query component. The data source component is used to return the results of the query (called a result set) from the query to data-aware components for display. Connect data-aware components to the data source using their DataSource and DataField properties.
5[tab]Activate the query component. For queries that return a result set, use the Active property or the Open method. For queries that only perform an action on a table and return no result set, use the ExecSQL method.
To execute a query for the first time at runtime, follow these steps:
1[tab]Close the query component.
2[tab]Provide an SQL statement in the SQL property if you did not set the SQL property at design time, or if you want to change the SQL statement already provided. To use the design-time statement as is, skip this step. For more information about setting the SQL property, see "Specifying the SQL statement to execute" in you help files
3[tab]Set parameters and parameter values in the Params property either directly or by using the ParamByName method. If a query does not contain parameters, or the parameters set at design time are unchanged, skip this step. For more information about setting parameters, see "Setting parameters" in you help files. This may be where your troubles lie.
4[tab]Call Prepare to initialize the BDE and bind parameter values into the query. Calling Prepare is optional, though highly recommended. For more information about preparing a query, see "Preparing a query" in your help files.
5[tab]Call Open for queries that return a result set, or call ExecSQL for queries that do not return a result set. For more information about opening and executing a query see "Executing a query" in you help files. James P. Cottingham
When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.