with self.ADOQuery1 do
begin
active:=false;
sql.text:='select name from sysobjects where type='''+'u''';
active:=true;
combobox2.Clear;
first;
while not eof do
begin
combobox2.Items.Add(fields[0].asstring);
next;
end;
active:=false;
combobox2.ItemIndex:=0;
end;
可以获得所有表名,如何让dbgrid显示就不用说了吧