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?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.