主要用到的组件ADOTable、dbcombobox、Button等
在SQL2000中建立了一个名字为USERS的数据表字段包括name password
现在的问题是ADOTable、dbcombobox均已经连接上,数据库已经联好,但是为什么dbcombobox的下拉列表显示不出来?手动输入name password可以,但是下拉的状态显示不出来,是dbcombobox的什么属性没设置好吗?
在SQL2000中建立了一个名字为USERS的数据表字段包括name password
现在的问题是ADOTable、dbcombobox均已经连接上,数据库已经联好,但是为什么dbcombobox的下拉列表显示不出来?手动输入name password可以,但是下拉的状态显示不出来,是dbcombobox的什么属性没设置好吗?
adoQuery1.Close;
adoQuery1.SQL.Clear;
adoQuery1.SQL.Add('select distinct xxx字段 from xxx表 where type is not null');
adoQuery1.Open;
DBComboBox1.Items.Clear;
while not adoQuery1.Eof do
begin
DBComboBox1.Items.Add(adoQuery1.FieldValues['xxx字段']);
adoQuery1.Next;
end;
adoQuery1.Close;
用combobox自己添加进去就有列表了啊