帮帮忙 ( 积分: 100 )

  • 主题发起人 主题发起人 c00c00a55
  • 开始时间 开始时间
C

c00c00a55

Unregistered / Unconfirmed
GUEST, unregistred user!
var
ini:tinifile;
ssp:string;
begin
ssp := '品牌添加';
ini:=Tinifile.Create('c:/kang.ini');
ini.WriteString('one',datetimetostr(now),ssp);
ini.Free;
dbcombobox1.Clear;
dbcombobox2.Clear;
dbcombobox3.Clear;
dbcombobox4.Clear;
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select distinct changbian from pinbiao');
open;
end;
adoquery1.First;
while not adoquery1.Eof do
begin
dbcombobox1.Items.Add(inttostr(adoquery1.fieldbyname('changbian').AsInteger));
adoquery1.Next;
end;
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select pingpai from pinbiao');
open;
end;
if adoquery1.RecordCount<>0 then
begin
adoquery1.First;
while not adoquery1.Eof do
begin
dbcombobox2.Items.Add(adoquery1.fieldbyname('pingpai').AsString);
adoquery1.Next;
end;
end;
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select xinghao from pinbiao');
open;
end;
if adoquery1.RecordCount<>0 then
begin
adoquery1.First;
while not adoquery1.Eof do
begin
dbcombobox3.Items.Add(adoquery1.fieldbyname('xinghao').AsString);
adoquery1.Next;
end;
end;
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select guige from pinbiao');
open;
end;
if adoquery1.RecordCount<>0 then
begin
adoquery1.First;
while not adoquery1.Eof do
begin
dbcombobox4.Items.Add(adoquery1.fieldbyname('guige').AsString);
adoquery1.Next;
end;
end;
end;
错误提示
 
晕倒~~
dbcombobox设下属性就能实现你的功能
 
不可以 你自己设置一下看看!那个要用DBLookupComboBox1,用属性设置dbcombobox只能显示一条数据
 
控件的使用方法不对,不应该有类似以下语句的出现:
dbcombobox1.Items.Add(inttostr(adoquery1.fieldbyname('changbian').AsInteger));
 

Similar threads

S
回复
0
查看
685
SUNSTONE的Delphi笔记
S
S
回复
0
查看
645
SUNSTONE的Delphi笔记
S
S
回复
0
查看
857
SUNSTONE的Delphi笔记
S
I
回复
0
查看
653
import
I
I
回复
0
查看
503
import
I
后退
顶部