2

i have the following query

SELECT *
FROM Project
WHERE Status = "In Progress"

when i run the program it successfully lists all the project titles with the status 'In Progress' in a DBlookuplistbox, I have a button with the code:

adoqCurrentProjects.Active := false;
adoqCurrentProjects.Active := true;

adoqCurrentProjects is the name of the adoquery, however when i click the button the error message 'Data type mismatch in criteria expression' appears. I would have thought that if i changed the amount of records in the Project table with the status "In Progress" and clicked the button it would just list the new results in the DBlookuplistbox as it does when i restart the program, any suggestions?

4

1 回答 1

1

更新 ADOQuery 的替代过程可能是

with adoqCurrentProjects do begin
 close;
 sql.Clear;
 sql.Add('SELECT * FROM Project WHERE Status = '+condition);
 open;
end;

// Update DBlookuplistbox
于 2012-04-27T09:49:56.437 回答