我刚才用它的sql编辑器写了查询功能可以用了。
但是我用相似的办法写插入功能就提示:
adoquery1:commandtext does not return a result set.
我写的插入代码如下:
   adoquery1.close;
   adoquery1.SQL.Clear;
   adoquery1.SQL.Add('insert power(power,pass,id)');
   adoquery1.SQL.Add('values("hehe"+","+"hehe"+","+"hehe")');
   adoquery1.open;
可能是我方法错了,但是看帮助里用adoconnection的execute又不会写参数。
请大家帮忙看看。

解决方案 »

  1.   

    adoquery1.close;
       adoquery1.SQL.Clear;
       adoquery1.SQL.Add('insert into power(power,pass,id)');
       adoquery1.SQL.Add('values("hehe","hehe","hehe")');
       adoquery1.open;
      

  2.   

    adoquery1.close;
       adoquery1.SQL.Clear;
       adoquery1.SQL.Add('insert into power(power,pass,id)');
       adoquery1.SQL.Add('values(''hehe'',''hehe'',''hehe'')');
       adoquery1.open;
      

  3.   

    adoquery1.close;
       adoquery1.SQL.Clear;
       adoquery1.SQL.Add('insert into power(power,pass,id)');
       adoquery1.SQL.Add('values(''hehe'',''hehe'',''hehe'')');
       adoquery1.ExecSQL;//不能用Open
      

  4.   

    出来新的问题:
    提示:insert into语句的语法错误
      

  5.   

    用execsql还是出现insert into语句的语法错误提示啊
      

  6.   

    什么数据库?
    建议更改表名:power,一般它是系统专用的函数!把power字段也要改名
    power,pass,id是字符型吗?你仔细检查一吧!
      

  7.   

    adoquery1.close;
       adoquery1.SQL.Clear;
       adoquery1.SQL.Add('insert into power(power,pass,id) values('hehe','hehe','hehe');
       adoquery1.execsql;
      

  8.   

    access数据库,我检查了一下,好象不是名字的故。
      

  9.   

    adoquery1.close;
       adoquery1.SQL.Clear;
       adoquery1.SQL.Add('insert into power(power,pass,id)');
       adoquery1.SQL.Add('values('hehe','hehe','hehe')');
       adoquery1.ExecSQL;
    用单引
      

  10.   

    var sqlstr:string;sqlstr:='insert into power(power,pass,id) values(''hehe'',''hehe'',''hehe'')';adoquery1.close;
    adoquery1.SQL.Clear;
    adoquery1.SQL.Add(sqlstr);
    adoquery1.ExecSQL;
      

  11.   

    谢谢,不过还是不行。仍然是 insert into 语句的语法错误提示