level 1
delphi中sql语句怎么用字符串条件
sql.text:='select Description from dictionary where Type ='+s;
这样写当数据传到数据库时,s上边由于缺了两个‘’(单引号),不是字符类型,提示类型不存在,要怎么写才能让s传到数据库时,变为‘s’
2015年01月09日 03点01分
1
level 7
sql.text:='select Description from dictionary where Type ='+quotedstr(s);
2015年01月09日 09点01分
3
另外,总感觉type这个名字作为字段,可能会是系统保留关键字,建议用一个特别一点的名字。
2015年01月11日 10点01分
level 3
sql.text:='select Description from dictionary where Type ='''+s+'''';
2015年01月11日 05点01分
4