SQLstr:='delete from table where ProjectID='''+str+'''';
问题解决: SQLstr:='delete from 项目保存表 where ProjectID=:str'; with ADOQuery1 do begin close; sql.Clear ; sql.Add(SQLstr); ADOQuery1.Parameters.ParamByName('str').Value:=str; ExecSQL; end;为什么一定要用动态参数?报错的原因是什么?请赐教
SQLstr:='delete from table where ProjectID=:param1' with ADOQuery1 do begin close; sql.Clear ; sql.Add(SQLstr); params[0].asstring:=str; ExecSQL; end;
SQLstr:='delete from 项目保存表 where ProjectID=:str';
with ADOQuery1 do begin
close;
sql.Clear ;
sql.Add(SQLstr);
ADOQuery1.Parameters.ParamByName('str').Value:=str;
ExecSQL;
end;为什么一定要用动态参数?报错的原因是什么?请赐教
with ADOQuery1 do
begin
close;
sql.Clear ;
sql.Add(SQLstr);
params[0].asstring:=str;
ExecSQL;
end;