查询、添加问题
我在输入按正常的查询都行。。
就是在输入框输入单引号' 就报错,我是用SQL拼接进行操作的
我知道有一种是传参数进行操作的,但是服务端的限制,而不能用。。。所以只能用拼接
请问大侠们,有什么解决方法呢。。。
[解决办法]
sql.text:='select * from t where f='''+Quotedstr(Edit1.Text)+''';
改成
sql.text:='select * from t where f='+Quotedstr(Edit1.Text);
发布时间: 2012-10-24 14:15:58 作者: rapoo
查询、添加问题
我在输入按正常的查询都行。。
就是在输入框输入单引号' 就报错,我是用SQL拼接进行操作的
我知道有一种是传参数进行操作的,但是服务端的限制,而不能用。。。所以只能用拼接
请问大侠们,有什么解决方法呢。。。
[解决办法]
sql.text:='select * from t where f='''+Quotedstr(Edit1.Text)+''';
改成
sql.text:='select * from t where f='+Quotedstr(Edit1.Text);