我用了最土的方法修改了
原: sCommandText := StringReplace(sCommandText, sFieldNameParam, QuotedStr(VarToStr(nValue)), [rfReplaceAll])
改为:
if bOld then
sCommandText := StringReplace(sCommandText, sFieldNameParam, QuotedStr(VarToStr(nValue)), [rfReplaceAll])
else
begin
sCommandText := StringReplace(sCommandText, sFieldNameParam+',', QuotedStr(VarToStr(nValue))+',', [rfReplaceAll]);
sCommandText := StringReplace(sCommandText, sFieldNameParam+')', QuotedStr(VarToStr(nValue))+')', [rfReplaceAll]);
end;
字段列表的字段列表名后面,一般为 ; 号 或 ) 号,如不是的话,说明他替换时不是完整的字段名
|