adoquery1.SQL.Add('select * from JY where id = :id'); parameters.parambyname('id').value:=s;
adoquery1.SQL.Add('select * from JY where id = :id'); parameters.parambyname('id').value:=s; oradoquery1.SQL.Add('select * from JY where id = ''' + s+'''');
s := trim(adotable1.FieldByName('ID').AsString); adoquery1.SQL.Add('select * from JY where id = ''' +s+''' ');
s := adotable1.FieldByName('ID').AsString; adoquery1.Close; adoquery1.SQL.Clear; 如果你的ID字段为数值型 adoquery1.SQL.Add('select * from JY where id = ' + s); 如果你的ID字段为字符串型 adoquery1.SQL.Add('select * from JY where id = ''' + s+''''); adoquery1.Open;
s := adotable1.FieldByName('ID').AsString; adoquery1.SQL.text:=format('select * from JY where id =''%s'' ',[s]);
adoquery1.SQL.Add('select * from JY where id = ''' + s + '''');
parameters.parambyname('id').value:=s;
parameters.parambyname('id').value:=s; oradoquery1.SQL.Add('select * from JY where id = ''' + s+'''');
adoquery1.SQL.Add('select * from JY where id = ''' +s+''' ');
adoquery1.Close;
adoquery1.SQL.Clear;
如果你的ID字段为数值型
adoquery1.SQL.Add('select * from JY where id = ' + s);
如果你的ID字段为字符串型
adoquery1.SQL.Add('select * from JY where id = ''' + s+'''');
adoquery1.Open;
adoquery1.SQL.text:=format('select * from JY where id =''%s'' ',[s]);