procedure TForm1.ComboBox1Select(Sender: TObject);
begin
with ADOQuery1 do
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from product where id=' + ComboBox1.Text);
ADOQuery1.Open;
Edit1.Text := ADOQuery1.FieldByName('商品名称').Value;
//Edit2.Text := ADOQuery1.FieldByName(' ').Value;
//............其他数据
end;
end;
如果是用adoquery的话,用Locate方法查找记录
aqu.Locate('编号',combobox1.text,[]);
edit1.text:=aqu.fieldbyname('名称').asstring;
....