呵呵,我知道了,你不因该
sql.clear,然后再  query9.active
这样做等于sql语句为空了

解决方案 »

  1.   

    不同意楼上的说法
    Query9.sql.SetText(pchar(str));
    这句已经加上去了
      

  2.   

    showmessage(M1);
    showmessage(M9);
    //str:='select m9 from zutzgl where TzglID='''+trim('1')+'''';
    //showmessage(str);
    if Query9.Active then
      Query9.Active:=false;
      Query9.sql.clear;  with ADOQuery3_Tmp.Parameters.AddParameter do
      begin
        Name := 'simon';
        DataType := ftString;
        Direction := pdInput;
        Value := M9;
      end;
      str:='select :simon from zutzgl where TzglID='''+trim('1')+'''';  Query9.sql.SetText(pchar(str));
      query9.active:=true;
      

  3.   

    呵呵
    str:='select ‘ + m9 + ’from zutzgl where TzglID='''+trim('1')+'''';