Ask experts: Use all records of a field in the data table as the dbcombobox option ??? Hope !!!

Source: Internet
Author: User
Ask experts: Use all records of a field in the data table as the dbcombobox option ??? Hope !!! Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiDB/html/delphi_20061221154622183.html
Data Table wzmc
Field wzmc
Record 1: Steel
Record 2: Wood
Record 3: Coal
Record 4: Cement
How do I use all records of the wzmc field as the option of dbcombobox ??

Traverse the table and insert the dbcombobox drop-down list

With query1 do
Begin
Close;
SQL. Clear;
SQL. Add ('select wzmc from wzmc ');
Open;
First;
Dbcombobox1.items. Clear;
While not EOF do
Begin
Dbcombobox1.items. Add (query1.fieldbyname ('wzmc '). asstring );
Next;
End;

End;

Thank you !! I understand. But do I have to traverse the table and set the rows in the attribute?

No, it seems that BDE can be used. It's not necessary for a long time. You cannot be sure.

Then you need to use dblookupcombobox

Thank you !! I understand !!

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.