我的SQL語句是 select * into #ttt12 from ControllerData
但報錯 COMMAND text Does not return a result set  
請問大家原因。

解决方案 »

  1.   

    要用execsql;
                    with adoquery1 do
                         begin
                            close;
                           sql.clear;
                          sql.add('select * into #ttt12 from ControllerData');
                          execsql;
                         end;
      

  2.   

    with adoquery1 do
                         begin
                            close;
                           sql.clear;
                          sql.add('if exists(select * from sysobjects where type=''u''
                                   and name=#ttt12)');
                          sql.add('drop table #ttt12');
                          sql.add('select * into #ttt12 from ControllerData');
                          execsql;
                         end;
      

  3.   

    select * into #ttt12 from ControllerData
    是不会返回纪录集的。
    执行没有返回纪录集的SQL,用execsql运行。