我用ADOQuery控件连接数据库
代码如下:
with form1.ADOQuery1 do
begin
close;
sql.Clear;
sql.Text := 'INSERT INTO pwd VALUES (''sun'',''111'')' ;
open;//出错点
end ;
当程序执行到所示点时,出现一下出错信息
请问怎么办?
project1.exe raise exception class EDatabaseError with message 'ADOQuery1:CommandText does not return a result set' . project project1.exe raised exception class EOleException with message 'Current provider does not support returning multiple recordsets from a single execution
代码如下:
with form1.ADOQuery1 do
begin
close;
sql.Clear;
sql.Text := 'INSERT INTO pwd VALUES (''sun'',''111'')' ;
open;//出错点
end ;
当程序执行到所示点时,出现一下出错信息
请问怎么办?
project1.exe raise exception class EDatabaseError with message 'ADOQuery1:CommandText does not return a result set' . project project1.exe raised exception class EOleException with message 'Current provider does not support returning multiple recordsets from a single execution
改成:
ExecSQL; //执行insert,update,delete都用这个;open是执行select时用的。