我用的三层结构
在前端调用数据时老是出现
raised exception class edbclient with message 'invalid parameter'
下面是代码
  with cntRefer do
  begin
    close;
  temp:=' select a.BillNo,a.sequence as BillSeqNum,a.itemno,b.ItemName,b.ModeSpec,a.MeasureUnit,b.costprice as LocalPrice, '+
         '  b.BarCode,b.OldItemNo,'''' as TradeName,isnull(quantity,0) as AllQty,0 as TranOutQty,a.reserved4 as VendCustCode,a.reserved5 as VendCustName '+
         '  from pur_transorderdetail a,pub_itemlist b ,pur_transordermaster c  '+
         '  where a.itemno=b.itemno and c.billno=a.billno  '
        commandtext:=temp;
       open;事实上里面根本就没有用到参数
请哪位大侠指教一下我

解决方案 »

  1.   

    close;
      temp:=' select a.BillNo,a.sequence as BillSeqNum,a.itemno,b.ItemName,b.ModeSpec,a.MeasureUnit,b.costprice as LocalPrice, '+
             '  b.BarCode,b.OldItemNo,'''' as TradeName,isnull(quantity,0) as AllQty,0 as TranOutQty,a.reserved4 as VendCustCode,a.reserved5 as VendCustName '+
             '  from pur_transorderdetail a,pub_itemlist b ,pur_transordermaster c  '+
             '  where a.itemno=b.itemno and c.billno=a.billno  '
            commandtext:=temp;
    直接把SQL语句赋给commandtext就可以了,没有必要用temp;
      

  2.   

    我用temp是作跟踪用的
    改了还是有误的
      

  3.   

    with cntRefer do
      begin
      Params.Clear;    //可能你在别的地方加用到了参数
      

  4.   

    把select语句放到最小,然后逐渐增加内容,检查错误