delphi中sql.add('select * from customer where zb=a')哪里有错

来源:百度知道 编辑:UC知道 时间:2024/09/21 21:47:50
执行不了 说列a无效 为什么

在Delphi里面应该是 sql.add('select * from customer where zb=:a')
其中:a在里面表示一个变量,然后再用
parameter.parametename('a').values=窗体上对应的控件名 对变量进行声明

sql.add('select * from customer where zb=''a''')

a必须要用""引起,
根据不同的数据库这个引号是不一样的。

你的引号有错误,A是变量,必须要有引号括起来,你应该改成这样
sql.add('select * from customer where zb=''a''') 或者
sql.add('select * from customer where zb='+#39+a+#39) ,#39代表一个引号