[:D]我想在一个窗体上放几个控件,比喻4个combobox和一个label,实现这样一个功能,
这4个combobox分别和数据库的4个fields关联,每选择一个combobox就对数据库作
一次筛选,然后逐步找到我需要的值出现在label上,请问怎么做?
问题是这4个字段每个字段都有相同的值。用lookupcombobox不行。请不要告诉我笨办法,我想出来的都是笨办法!!呵呵

解决方案 »

  1.   

    建议表结构这样设计:
    以大小类为例: 
    大类     小类          内容
    01       0101         A1
    01       0102         A2

    03       0301         C1
    03       0302         C2
      

  2.   

    s_1:='select * from '+adoSCXZ.Filter+' where id is not null';  if (timefront.value<>null) or (timeback.Value<>null) then
         if (timefront.value<>NULL) and (timeback.value<>NULL) then
            s_1:=s_1+' and  rq between '''+timefront.Text+''' and '''+timeback.text+''' '
            else
              if timefront.value<>null then
                s_1:=s_1+' and rq='''+timefront.Text+''''
                else
                s_1:=s_1+' and rq='''+timeback.Text+'''';
         if (comsc.Text<>'') and (comsc.Text<>'全部')  then
             s_1:=s_1+' and mc like "%'+comsc.Text+'%"';
         if (comgx.Text<>'') and (comgx.Text<>'全部') then
             s_1:=s_1+' and mc_1 like "%'+comgx.Text+'%"';    adogx.sql.clear;
        adogx.sql.add(s_1);
        //showmessage(s_1);
        adogx.open;
      

  3.   

    代码如下:
        with   blueprint_priceQuery   do
      begin
       close;
       SQL.Clear;
       SQL.Add('select  *  from  blueprint_price ');
       SQL.Add('where  size:=aa');
       Parameters.Refresh;
       Parameters.ParamByName('aa').Value:=combobox2.Text;
       Prepared;
       ExecSQL;麻烦各位英雄解决啊!
     出错:
    错误提示:paramters找不到'aa'而我的blueprint_pricequery里有aa呀!