我想用combobox显示我数据库中talbe1表中的字段field1的内容,但是field1字段的内容是用代码表示的,它对应的字段在表table2中的字段field01中,我如何该如何做呢?
field1
--------
1
2
3field01
------------
语文
数学
英语我想显示在combobox中的是
语文
数学
英语

解决方案 »

  1.   

    可以用DBcombobox数据库控件,然后连接field01字段就可以了
      

  2.   

    select field01 from table02 where id=(select field1 from table1 where 你的条件)
    或者
    select a.*,b.* from table1 a,table2 b where a.field1=b.id and table1的其他条件把FIELD01加进combobox就可以了.
      

  3.   

    同意 wintergoes(多来米饭少来稀)的方法楼主可以通过id查询出对象的name
    然后将name加入到ComboBox中