C
crazypc
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Edit2Change(Sender: TObject);
begin
with data.adoquery1 do
begin
data.adoquery1.Close;
data.adoquery1.SQL.Clear;
data.adoquery1.SQL.Add('select 厂商名 from G_cs ');
data.adoquery1.SQL.Add('where G_cs.厂商代码 =:fno');
data.adoquery1.Parameters.ParamByName('fno').Value :=edit2.text;
data.adoquery1.Open;
end;
label9.Caption:=data.ADOQuery1.Fields[1].Value;
end;
系统提示:lsit index out of bounds(1)?
为什么不行?
begin
with data.adoquery1 do
begin
data.adoquery1.Close;
data.adoquery1.SQL.Clear;
data.adoquery1.SQL.Add('select 厂商名 from G_cs ');
data.adoquery1.SQL.Add('where G_cs.厂商代码 =:fno');
data.adoquery1.Parameters.ParamByName('fno').Value :=edit2.text;
data.adoquery1.Open;
end;
label9.Caption:=data.ADOQuery1.Fields[1].Value;
end;
系统提示:lsit index out of bounds(1)?
为什么不行?