查询语句如下: select distinct type from store where name = "five"
在tquery控件的sql语句中随便我我怎么写,都出现这个错误:
“参数不足,期待是1”我的写法有:sql.Text:='select distinct type from store where name ="five";'; 或者是
sql.Add('select distinct type ');
sql.Add('from store ') ;
sql.add('where name = "five"');为什么“ where name ="five";”这句有问题呢?
那该怎么写那?
在tquery控件的sql语句中随便我我怎么写,都出现这个错误:
“参数不足,期待是1”我的写法有:sql.Text:='select distinct type from store where name ="five";'; 或者是
sql.Add('select distinct type ');
sql.Add('from store ') ;
sql.add('where name = "five"');为什么“ where name ="five";”这句有问题呢?
那该怎么写那?
解决方案 »
- 如何在本地生成一个html?
- DBGridEH里镶嵌了CheckBox,当打勾或取消打勾时触发什么事件?
- 如何把数据库里找到的内容
- 简单问题,不过很烦!帮帮忙
- 贴者有分!我正作可视会议系统,请各位帮忙策划策划
- 本人是计算机系的,现在想学一种以后会有很好发展的编程语言或者计算机方面的技术,希望大家给点建议!
- QuickRep中的QRMemo的行高如何控制
- 做了个程序,用于快速打开程序或网址,请大家看看。
- 这个想法应该怎么来实现? ************ 在线等 *************
- 安装程序的问题--install shield+delphi
- 关于ADOQuery的问题,急
- 当mouse在TStringGrid外单击时,TStringGrid如何得到通知?
sql.Text:='select distinct type from store where name =''five'';';
access的写法:
sql.Text:='select distinct type from store where name ="five";';
sql.Add('select distinct type ');
sql.Add('from store ') ;
sql.add('where name = ''five''');
access写法:
sql.Add('select distinct type ');
sql.Add('from store ') ;
sql.add('where name = "five"');
我用的就是access啊,
你的写法不是和我的一样的吗?
不行啊,那样些就出现那个错误,
把你的答案反回来就对了,
access是sql.add('where name = ''five''');
好象ACCESS裡面,字符串也是用單引號的哦。
Sql Add ('select distinct type from store where name ='+''''+five+'''');這是加在 Tquery 控件語句里的﹗
sql.Add('select distinct type from store where name = ''five''');