Why do I always click the "query" button twice for the query result, and the query result will be displayed after I click it once? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiDB/html/delphi_20061219170657216.html
When I use Delphi for query, tadoquery is used and parameters are passed for query. However, when the query form is just opened, why do I always need to click "query" twice to get the result, after you click "query", the result will be displayed?
Below is Code Please help me analyze what is going on and how to get rid of this error!
// Execute the query
Procedure tfrmbookfeequery. bitbtn2click (Sender: tobject );
Begin // execute the query
With queryds do
Begin
Close;
Parameters. Clear;
Parameters. createparameter ('@ V', ftstring, pdinput, 20, combobox1.text );
If radiobutton1.checked then
Begin
Commandtext: = 'select * From feehistory where [classname] =: V ';
End
Else
Begin
Commandtext: = 'select * from orders where [departmentname] =: V ';
End;
Active: = true;
End;
End;
Open
I can't do it anymore. It's still the same.
Obviously, tadoquery does not contain commandtext, and you are not prompted for an error?
Up, I have also met
Queryds is a TADODataSet component.