请问ADOquery怎样执行插入的啊?
我这样老是说当前提供程序不支持从单一执行返回多个记录!郁闷啊!
不知道为什么大家帮帮我吧
query.SQL.Add('insert into exam(content,selection,standardans) '+
         'values('+''''+'fjkdsf'+''''+','+''''+'fsdf'+''''+','+''''+'A'+''''+')');
         query.Open;
         query.ExecSQL;
        showmessage('fdsf');
        query.Close;

解决方案 »

  1.   

    query.Open;
    query.Close;
    这2个去掉
      

  2.   

    这个('+''''+'fjkdsf'+''''+','+''''+'fsdf'+''''+','+''''+'A'+''''+')');
    怎么看起来很便扭,
    query.Open;
    query.Close;这两个要去掉,再检查一下你的values
      

  3.   

    同意,检查一下你的values的值, 也可以在数据库上直接执行你的SQL语句,看看结果,这样就很容易查出是哪的问题了!
      

  4.   

    1.'fjkdsf'等若是字符常量,在SQL文中要用双引号括起来
    query.Close;
    query.SQL.Text := 'insert into exam(content,selection,standardans) values (''fjkdsf'', ''fsdf'', ''A'') ';
    query.ExecSQL;2.還可用付値形式
    query.Close;
    query.SQL.Text := 'insert into exam(content,selection,standardans) values (' + QuotedStr(edit1.text) + ',' + QuotedStr(edit2.text) + ',' + QuotedStr(edit3.text) + ')';
    query.ExecSQL;
      

  5.   

    Open返回查询结果,ExecSQL不返回查询结果。