用socket连接时,怎样让服务器上数据库中的记录显示在客户端combobox1上来?

解决方案 »

  1.   

    var
      query : TAdoQuery;
    ...
      combobox1.items.clear;
      query.close;
      query.sql.clear;
      query.sql.add('SELECT DISTINCT fieldname FROM tablename');
      try
        query.open;
        while not query.eof do
        begin
          combobox1.items.add(query.fieldbyname('fieldname').asstring);
          query.next;
        end;
      finally
        query.close;
      end;
    end;
      

  2.   

    怎样全部显示数据在dbcombobox上?为什么始终只显示第一条