我有一个数据库,并希望用TYPE = RKE的partnumbers填充组合框 但是,当我运行此代码时,它会出错
参数xxx没有默认值。
procedure TFMain.ComboTypeClick(Sender: TObject);
var
Qry:TADOQuery;
begin
Qry:=TADOQuery.Create(self);
try
Qry.Connection:=PronetConnection; //pronet is adoconnection
Qry.SQL.Clear;
Qry.SQL.Add('Select PartNumber FROM PNet WHERE Type = RKE');
Qry.Open;
with Qry do
begin
First;
ComboType.Items.Clear;
while not eof do
begin
ComboNumber.Items.Add(FieldByName('PartNumber').AsString);
Next;
end;
end;
finally
Qry.Active:=False;
Qry.Free;
end;
end;
答案 0 :(得分:1)
我认为错误发生在sql脚本中。
Qry.SQL.Add('Select PartNumber FROM PNet WHERE Type = '+QuotedStr('RKE'));