求助!!!delphi 多条件查询
delphi吧
全部回复
仅看楼主
level 1
jimmkey 楼主
请大神帮忙。
数据库名为:总库。
查询型号为form2.ComboBox3.Text,封装为form2.ComboBox4.text的器件。以下语句为什么查询不到????
begin
form1.ADOQuery4.Close ;
form1.adoquery4.sql.text:='select * from 总库 where 型号='''+form2.ComboBox3.Text+' 封装='+form2.ComboBox4.text+''' ';
form1.ADOQuery4.Open ;
if form1.adoquery4.recordcount>0 then
begin
MessageDlg('查到该器件',mtConfirmation, [mbYes], 0);
end
else
begin
MessageDlg('未查到该器件',mtConfirmation, [mbYes], 0);
end;
end;
2016年08月22日 05点08分 1
level 12
SQL语句错了吧?
select * from 表名 where 条件1 and 条件2 ;
2016年08月23日 03点08分 3
level 12
另外,为什么表名和字段要用中文呢,,,多麻烦~
2016年08月23日 03点08分 4
表名和字段用中文这种陋习不但在各初学者中活跃,而且广泛存在于世界500强的所谓各大技术精英中。
2016年09月12日 08点09分
@HeGlowing 确实是陋习
2016年09月24日 06点09分
1