老兄,你哪个可以显示,
但是,怎样能避免这两个button 的循环调用那?
procedure TForm1.Button1Click(Sender: TObject);
begin
if EditConnectionString(adoconnection1) then begin
adoconnection1.Open();
adoconnection1.GetTableNames(combobox1.Items);
edit1.Text :='数据库表的个数为:'+inttostr(combobox1.Items.Count );
end else begin
Button2Click(nil) ;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
try
adoconnection1.ConnectionString :='FILE NAME='+extractfilepath(application.ExeName )+'ado.udl';
adoconnection1.Open();
adoconnection1.GetTableNames(combobox1.Items );
edit1.Text :='数据库表的个数为:'+inttostr(combobox1.Items.Count );
self.Button2.Enabled:=false ;
//finally
except
begin
button1click(nil);
end;
end;
end;