当前位置:主页>仓库管理软件> 列表

一个selcet 搜索语句的语法问题

销售管理软件版1楼: adoquery1.SQL.add(''select 读者编号,图书编号 from 图书借阅 where 读者编号='''' ''+edit6.text+'' '''' and 图书编号=''''''+edit1.Text+'''''''''');

上面在我用delphi编的一个SQL查询语句,但delphi提示:unterminated string
不知道我这句哪里多了或者少了个引号(被这些引号快搞死了)?

2楼: 哈哈哈,试试:
adoquery1.SQL.add(''select 读者编号,图书编号 from 图书借阅 where 读者编号=''+QuotedStr(edit6.text)+'' and 图书编号= ''+QuotedStr(edit1.Text)); 如免费网吧管理软件

3楼: adoquery1.sql.text:=''select 读者编号,图书编号 from 图书借阅 where 读者编号=''
+edit6.text
+'' ''+ ''and 图书编号=''
+'' ''+edit1.Text;

4楼: 最后多了一个单引号,应为:

adoquery1.SQL.add(''select 读者编号,图书编号 from 图书借阅 where 读者编号='''' ''+edit6.text+'' '''' and 图书编号=''''''+edit1.Text+'''''''');

5楼: 建议使用QuotedStr函数,它是专门干这个用的!

6楼: 谢谢各位帮忙,我是新人分太少,帮忙的人太多.请大家别介意啊