with query1 do
begin
close;
sql.clear;
SQL.Add('select * from subsidary where pname=''s\''pore''');
//search the record it's name is s'pore
open;
if IsEmpty then
showmessage('no record');
close;
end;
有报错:"Missing right quote.", 用参数的方法可以处理,但为什么此方法不行?
thks.
begin
close;
sql.clear;
SQL.Add('select * from subsidary where pname=''s\''pore''');
//search the record it's name is s'pore
open;
if IsEmpty then
showmessage('no record');
close;
end;
有报错:"Missing right quote.", 用参数的方法可以处理,但为什么此方法不行?
thks.
解决方案 »
- delphi idcontext
- 中间层如何得到clientdataset上传的参数值
- 关于三层模式下用CLIENTDATASET读取BLOG字段的图片显示不全的问题
- 如何生成条码并保存成图片?
- 大家在从库存邻料是如保判段该仓库(st_no)是否有该料品(part_no)的呢?如果没有又该如何处理,是不让邻,还是
- 如何将delphi6中的日期时间转化为access97支持的格式?急切等待!!!
- BDE对SQL Server的事务缺陷,高手请进,100分奉上
- delphi7 tdbgrideh表格表头高度如何设置啊?
- 各位大虾:那里有Object pascal的资料下载,惊喜的等待^_^
- 请各位大师帮忙?为什么Dephi5.0在win2000下不能安装成功?
- 高手求教!!!!!!!!!!!!!!!!!!!,
- 打包基本问题,给分了~~~~~~~~~~~顶啊!!
如果你是要查找Pname=s'pore的记录的话
begin
close;
sql.clear;
SQL.Add('select * from subsidary where pname=''''s\''''+char(39)+''''pore''''');
//search the record it's name is s'pore
open;
if IsEmpty then
showmessage('no record');
close;
end;
有QUOTEDSTR()为什么不用?
SQL.Add('select * from subsidary where pname='+quotedstr('......'));
begin
close;
sql.clear;
SQL.Add('select * from subsidary where pname=''s\''+char(39)+''pore''');
//search the record it's name is s'pore
open;
if IsEmpty then
showmessage('no record');
close;
end;
--------------------------------------------------------------------------------
不好意思,刚刚写错了,惭愧!
begin
close;
sql.clear;
SQL.Add('select * from subsidary where pname=' + quotedstr('s''pore'));
//search the record it's name is s'pore
showmessage(sql.text);
open;
if IsEmpty then
showmessage('no record')
else
showmessage(inttostr(recordcount));
close;
end;