用TDBComboBox控件与数据库中的某个字段直接连接,为什么在TDBComboBox控件的列表中始终只有一条记录的信息?

解决方案 »

  1.   

    列表中的是要手工加上去的,不会自动有的,要的要自动有,可以用DBlookupCombobox,不过要是代码表才行
      

  2.   

    是你理解错了!
    TDBComboBox是用来显示/修改当前那条记录的指定字段的,并不是用来显示某个字段的所有的记录的值的。
    可以从这段话看出来:
    Use TDBComboBox to allow users to change the value of a field on the current record in a dataset either by selecting an item from a list or by typing in the edit box part of the control. The selected item or entered text becomes the new value of the field if the database combo box抯 ReadOnly property is False. The combo box can be customized to enable or disable typing in the edit region of the control, to display the list as a drop down or as a permanently displayed list, to sort the items in the list, and so on.