我在用 adoquery1.ExecSQL ;做的一个sql修改数据库的操作后。我用
adoquery1.Active:=false;
adoquery1.Active:=true;
执行了一次刷新,但是出现了ADOQuery1:commandText does not return a result set.错误提示。
我还用了adoquery1.refresh;但还是不行啊!
请问大虾是什么错误!

解决方案 »

  1.   

    你是不是adoquery.sql属性里有要返回值的sql语句了???
      

  2.   

    ADOQuery1.Sql.Clear ;
    ADOQuery1.Close ;
    ADOQuery1.Open ;
      

  3.   

    adoquery1.Close;
       adoquery1.SQL.Clear;
       if Visstr='insertOper' then
           begin
             adoquery1.SQL.Add('insert  into address(Dcode, Dadd)');
             adoquery1.SQL.add('values(:A,:B)');
             adoquery1.Parameters.ParamByName('A').Value:=uppercase(edit1.Text  );
             adoquery1.Parameters.ParamByName('B').Value:=edit2.Text;       end
       else  if Visstr='modifyoper' then
           begin
             adoquery1.SQL.Add('update address set  Dcode=:A,Dadd=:B');
             adoquery1.SQL.Add('where Dcode=:C');
             adoquery1.Parameters.ParamByName('A').Value:=uppercase(edit1.Text);
             adoquery1.Parameters.ParamByName('B').Value:=edit2.Text;
             adoquery1.Parameters.ParamByName('C').Value:=edit3.Text;
           end;   adoquery1.ExecSQL ;
       adoquery1.Active:=false;
       adoquery1.Active:=true;
    代码如下,不知道是哪方面的错误