一段程序看不懂?
procedure TForm1.FormCreate(Sender: TObject);begin
ComboBox1.Items.Clear;
with ADOQuery1 do
begin
Close;
SQL.Clear;
SQL.Add('select * from yxdmb order by yxdm');
Open;
try
First;
while not EOF do
begin
ComboBox1.Items.Add(Fields[1].Asstring);
Next;
end;
finally
EnableControls;
end;//End try
end; // ADOQuery1
ComboBox1.ItemIndex := 0;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
var n:integer;
str1:string;
begin
n := ComboBox1.ItemIndex;
with ADOQuery1 do
begin
First;
MoveBy(n);
end;
str1:=ADOQuery1.Fields[0].AsString;
with ADOQuery2 do
begin
Close;
SQL.Clear;
SQL.Add('select * from xsjbxxb where yxdm='''+str1+'''');
Open;
end;
end;
end.