主题:我写的这个函数帮看下哪儿错了
我写的这个函数帮看下哪儿错了,或少什么吗?
procedure TFormProduct.FormCreate(Sender: TObject);
var SelectField:String;
A,B,A1,B1:String;
begin
A:='品牌';
B:='产品类别';
A1:='DBComboBox3';
B1:='DBComboBox2';
SelectField(A,A1);
SelectField(B,B1);
end;
//***************取字段值***************//
{Function SelectField(fieldKeyW,Combo:String):String;
begin
FormConn.adoquery3.Close;
FormCOnn.ADOQuery3.SQL.Text:='Select '+fieldKeyW+' from Brand';
FormConn.ADOQuery3.open;
While Not FormCOnn.ADOQUery3.Eof DO
Begin
FormConn.ADOQuery3.First;
Combo.Items.Add(FOrmCOnn.ADOQUery3.fieldByName(''+fieldKeyW+'').AsString);
FormCOnn.ADOQUery3.Next;
End;
end;
}
procedure TFormProduct.FormCreate(Sender: TObject);
var SelectField:String;
A,B,A1,B1:String;
begin
A:='品牌';
B:='产品类别';
A1:='DBComboBox3';
B1:='DBComboBox2';
SelectField(A,A1);
SelectField(B,B1);
end;
//***************取字段值***************//
{Function SelectField(fieldKeyW,Combo:String):String;
begin
FormConn.adoquery3.Close;
FormCOnn.ADOQuery3.SQL.Text:='Select '+fieldKeyW+' from Brand';
FormConn.ADOQuery3.open;
While Not FormCOnn.ADOQUery3.Eof DO
Begin
FormConn.ADOQuery3.First;
Combo.Items.Add(FOrmCOnn.ADOQUery3.fieldByName(''+fieldKeyW+'').AsString);
FormCOnn.ADOQUery3.Next;
End;
end;
}