请问谁知道为什么会出现这样的错误提示?我在form6中调用form2中的adoquery但运行后出现以下错误!“adoquery1:commandtext does not return a result set”
更新语句代码如下:
form2.ADOQuery1.ConnectionString:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=gz;Data Source=YYY';
form2.ADOQuery1.SQL.Text:='update gz_bm set passw=convert(varchar,'''+edit2.text+''',107) where bmdm='''+form2.bm1+'''';
form2.ADOQuery1.Active:=true;
showmessage('修改成功!');
这是一个事件,运行没有问题,点击后会出现错误码提示如上,数据库中的数据已被修改成功!

解决方案 »

  1.   

    你的语句没返回数据集,用exec就行.
      

  2.   

    对于不返回数据集的SQL语句,不能用ADOQuery1.Active:=True或ADOQuery1.Open,
    而应该用:
    ADOQuery1.ExecSQL;祝你好运。
      

  3.   

    select的 用ADOQuery1.Open,
    而insert,delete,update的 用ADOQuery1.ExecSQL
      

  4.   

    对于不返回数据集的SQL语句,不能用ADOQuery1.Active:=True或ADOQuery1.Open,
    而应该用:
    ADOQuery1.ExecSQL;
      

  5.   

    谢谢!但我不明白不返回数据集,什么意思!active 和execsql什么区别!