我做了个查询功能可是不知道为什么每次运行后点查询按纽总是提示"参数内型不正确,或不在可接受的范围之内,或与其他参数冲突"请问这是为什么,要怎么解决

解决方案 »

  1.   

    你检查一下传入SQL中的参数咯,看看数据类型有没有问题
      

  2.   

    我的代码是这样写的,如果是参数类型的问题我应怎么改
    procedure TForm7.SpeedButton1Click(Sender: TObject);
    var
    filterstr:string;
    begin
      filterstr:='';
      filterstr:=Format('(LIST_DATE,''YYYY-MM-DD'')>=''%s'' And (LIST_DATE,''YYYY-MM-DD'')<=''%s'' ',[FormatDateTime('YYYY-MM-DD',DateTimePicker1.Date),FormatDateTime('YYYY-MM-DD',DateTimePicker2.Date)]);
      if ComboBox5.Text <>'' then
        FilterStr := FilterStr + ' And LIST_TYPE = '+ComboBox5.Text
      else
        FilterStr := ' LIST_TYPE = '+ComboBox5.Text;
      if ComboBox1.Text<>'' then
      begin
         if ComboBox5.Text <>'' then
              filterstr:= filterstr +'and LIST_ITEM = '+ComboBox1.text
         else
              filterstr:= 'LIST_ITEM = '+ComboBox1.Text ;
      end;
      if ComboBox4.Text<>'' then
      begin
         if (ComboBox5.Text <>'')or(ComboBox1.Text <>'') then
              filterstr:= filterstr +'and LIST_ACCOUNT = '+ComboBox4.text
         else
              filterstr:= 'LIST_ACCOUNT = '+ComboBox4.Text ;
      end;  
      ADOTable1.Filtered  :=False;
      ADOTable1.Filter    := filterstr;
      ADOTable1.Filtered  :=True;
    end;