Not exactly sure of the problem here, but it sounds like you hard code the parameters.
When you create the query, the parameters should automatically be placed in the Parameter inspector.
If you want to hard code the parameters, just use the Parameter collection editor (the elipsis next to [tt]Params[/tt]). Then
[ul][li]set [tt]Params.Value.Type[/tt] to your parameters data type (date, OleString etc)[/li]
[li] then enter the value in the [tt]Params.Value[/tt] field[/li][/ul]
However, its not that hard to programattically alter the parameters either. An example of how I set up queries in linked tables (ACCESS in this case):[tt]
procedure AdjustBMDQuery;
{ Redo the ROI query to get all Densitometry records with same img_handle
The SQL statement:
SELECT img_handle, label, bmd
FROM Densitometry
WHERE Densitometry.img_handle = :image
ORDER by label;
}
begin
ADOquery_prevBMD.close; // redefine the BMD query for the specified ROI
ADOquery_prevBMD.Parameters.ParamByName('image').value :=
ADOquery_image.FieldValues['img_handle']; // get the ID of the image
ADOquery_prevBMD.open;
end; // procedure adjust query[/tt]
Finally, there are a couple of ways to check that your SQL is correct:
[ol][li] Put a DBGrid on your form, and link it to your table.
Set [tt]Active[/tt] to [tt]TRUE[/tt]
You can set the [tt]Parameters[/tt] as described above. Your data should appear in the grid[/li]
[li]Use the Database Desktop and test your query using SQL directly - you can't use parameters here, but substitute them directly viz:
[tt]SELECT ExamDate,ExamCode,Scanner,BillCode
FROM "k_upload.dbf" K_Upload
WHERE (((ExamCode NOT LIKE 'n125' + '%') OR (ExamCode IS NULL))
AND
(ExamDate BETWEEN '1.07.2003' AND '31.08.2003'))
ORDER BY ExamDate[/tt][/li]
[/ol]
Incidentally, I use the same sort of queries on both a BDE query and an ADO query.
Cheers
Chris ;-)