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