我用Delphi7和SQL2000做一个项目,按照ComboBox1.Text的条件查询StoreBill这个数据表,用的是TQuery和TDataSource连接数据库,查询Button的OnClick事件如下
if Trim(ComboBox1.Text)<>'' then
     begin
          with Query1 do
          begin
               Close;
               SQL.Clear;
               SQL.Add('select * from StoreBill where 配件名称 =: a');
               ParamByName('a').AsString := Trim(ComboBox1.Text);
               Open;
          end;
我的StoreBill数据表中没有'a',上面这段代码我也是参考人家的,运行工程,点击查询,提示的是“Query1 : Parameter 'a' not found”。求高手教教我应该怎么改,谢谢了