一个表,三个字段,
id,name,price一个form里有combobox,label1,label2
combobox在createform的时候已经读入了所有id的值,
要实现选择不同的id,label1和label2的caption随id的值而改变.
id,name,price一个form里有combobox,label1,label2
combobox在createform的时候已经读入了所有id的值,
要实现选择不同的id,label1和label2的caption随id的值而改变.
TQuery.SQL.Add('SELECT name,price FROM tablename where id=id');
TQuery.Open;
Label1.Caption := TQuery.FieldByName('name').AsString;
Label2.Caption := TQuery.FieldByName('price').AsString;