adoquery1.sql用到动态参数
where id=:id:id是来源与combobox1.text,combobox1的值是来源与adoquery2的id字段问题:combobox1可以每个值对应上面的动态参数了,但我在combobox1.item里
加了一个“全部ID”,就是选择所有的,
这个“全部ID”应该怎么对应where id=:id

解决方案 »

  1.   

    非得用参数吗?直接组合完整SQL多舒服
      

  2.   

    准备两个字符串
    Str1:='select * from yourtable';
    Str2:='select * from yourtable where ID=:ID';
    如果选择的是全部ID,则用Str1,选择了ID则用Str2
      

  3.   

    我的方法笨多了,不过可以用: hnhb(不死鸟) 你的这个不错:)
      

  4.   

    全部就是 str_all:=select * from yourtable where 1=1;
    其他的就是   str_id:=str_all+'and id=:id';
      

  5.   

    adoquery1.sql用到动态参数
    where id=:id or  id=  ['全部选中'.itemsindex] 这样不是不用动了