1、procedure TForm1.btn1Click(Sender: TObject);
var
s: String;
begin
S := 'select * from TMarketInfo where NO='''+'1''';
ShowMessage(s);
end;
结果显示:select * from TMarketInfo where NO='1'
2、procedure TForm1.btn1Click(Sender: TObject);
var
s: String;
begin
S := 'select * from TMarketInfo where NO='+'''1''';
ShowMessage(s);
end;
结果显示:select * from TMarketInfo where NO='1'
3、procedure TForm1.btn1Click(Sender: TObject);
var
s: String;
begin
S := 'select * from TMarketInfo where NO=''+1''';
ShowMessage(s);
end;
结果显示:select * from TMarketInfo where NO='+1'
4、procedure TForm1.btn1Click(Sender: TObject);
var
s: String;
begin
S := 'select * from TMarketInfo where NO='+'1';
ShowMessage(s);
end;
结果显示:select * from TMarketInfo where NO=1