dept_id和content是一个表的两个字段!

解决方案 »

  1.   

    先用Locate找到记录,然后用ComboBox2.Text := Table1.FieldByName('Content').AsString;或者ComboBxo2.Items.Add(Table1.FieldByName('Content').AsString);
      

  2.   

    ADOQuery1.CommandText :='select Content from yourtable where dept_id = 2';
    ADOQuery1.CommandType := adCommandText;
    ADORecordSet1 := ADOQuery.Execute
    while not ADORecordSet1.Eof do
    begin
      ComboBox2.Items.Add(ADORecordSet1.Fields['Content'].Value);
      ADORecordSet1.MoveNext;end大致是这么写
      

  3.   

    query1.close;
    query1.sql.clear;
    query1.sql.add('select * from table1 where dept_id=2');
    query1.open;
    query1.first;
    combobox1.items.clear;
    while not query1.eof do
    begin
       combobox1.items.add(query1.fieldbyname('Content').asstring);
    end;
      

  4.   

    对不起,循环里加句query1.next;
    query1.close;
    query1.sql.clear;
    query1.sql.add('select * from table1 where dept_id=2');
    query1.open;
    query1.first;
    combobox1.items.clear;
    while not query1.eof do
    begin
       combobox1.items.add(query1.fieldbyname('Content').asstring);
       query1.next;
    end;
      

  5.   

    什么意思,看不太懂。
    你是sql不会写还是程序不会写。
      

  6.   

    怎么用locate找到记录啊,看不懂帮助!哪位高手详细指点一下,谢谢了!
      

  7.   

    就是这个问题的延续了http://www.csdn.net/expert/topic/783/783384.xml?temp=.3602564大家帮我看看,我看了一下午了!
      

  8.   

    ADOQuery1.CommandText :='select Content from yourtable where dept_id = 2';
    ADOQuery1.CommandType := adCommandText;
    ADORecordSet1 := ADOQuery.Execute
    while not ADORecordSet1.Eof do
    begin
      ComboBox2.Items.Add(ADORecordSet1.Fields['Content'].Value);
      ADORecordSet1.MoveNext;
      

  9.   

    那我不是用的ADO,该怎么修改?