if optiflag='select' then
  begin
   with teadm do
   begin
      customer_Query.close;
      customer_Query.sql.Clear;
      customer_Query.SQL.Add('select * from customer where customerid=:ID');
      customer_Query.Params.ParamByName('ID').Value:=customerid;
      customer_query.Open;
   end;

解决方案 »

  1.   

    这样试一下:
      if optiflag='select' then 
      begin 
      with teadm do 
      begin 
          customer_Query.close; 
          customer_Query.sql.Clear; 
          customer_Query.SQL.Add('select * from customer where customerid='''++customerid''''); 
          customer_query.Open; 
      end;
      

  2.   

    语句没问题啊,你跟踪下看看customerid值有没有传进来啊
      

  3.   

      if optiflag='delete' then
      begin
        with teadm do
        begin
          customer_Query.close;
          customer_Query.sql.Clear;
          customer_Query.sql.Add('delete from customer_t where customerID='''+customerid+'''');
          customer_Query.execSQL;
        end;
      end;
      

  4.   

      if optiflag='delete' then
      begin
        with teadm do
        begin
          customer_Query.close;
          customer_Query.sql.Clear;
          customer_Query.sql.Add('delete from customer_t where customerID='''+customerid+'''');
          customer_Query.execSQL;
        end;
      end;
      

  5.   

    你查询将customer_query返回回去了没有哦
      

  6.   

    你怎么使用查询结果的?是直接用dbgrid还是别的方法?