火
火凤凰
Unregistered / Unconfirmed
GUEST, unregistred user!
程序如下:
type
TForm1 = class(TForm)
DBListBox1: TDBListBox;
DataSource1: TDataSource;
Query1: TQuery;
Button1: TButton;
DBGrid1: TDBGrid;
procedure Button1Click(Sender: TObject);
private
………………
procedure TForm1.Button1Click(Sender: TObject);
begin
query1.Close;
query1.SQL.Clear ;
query1.SQL.Add('SELECT 类别名称 FROM "lb.db" GROUP BY 类别名称');
query1.Open;
dblistbox1.DataSource:=DataSource1;
dblistbox1.DataField:='类别名称';
DBGrid1.DataSource:=DataSource1;
end;
为什么dblistbox1里没数据,而DBGrid1里有数据啊?
怎么让dblistbox1里显示SQL查询的数据?
type
TForm1 = class(TForm)
DBListBox1: TDBListBox;
DataSource1: TDataSource;
Query1: TQuery;
Button1: TButton;
DBGrid1: TDBGrid;
procedure Button1Click(Sender: TObject);
private
………………
procedure TForm1.Button1Click(Sender: TObject);
begin
query1.Close;
query1.SQL.Clear ;
query1.SQL.Add('SELECT 类别名称 FROM "lb.db" GROUP BY 类别名称');
query1.Open;
dblistbox1.DataSource:=DataSource1;
dblistbox1.DataField:='类别名称';
DBGrid1.DataSource:=DataSource1;
end;
为什么dblistbox1里没数据,而DBGrid1里有数据啊?
怎么让dblistbox1里显示SQL查询的数据?