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 !!