Procedure TMainFrm.DeleteFrist(Id:Integer);
var
Ado_tmp:TADODataset;
tmpId:integer;
begin
Ado_tmp:=TADODataSet.Create(Self);
Ado_tmp.Connection:=ADOConnection1;
with Ado_tmp do
try
Close;
ado_tmp.CommandType:=cmdText;
commandtext:='delete from treetxl where Id='+IntToStr(Id);
open;
finally
ado_tmp.Free;
end;
end;
老是报"当前提供程序不支持从单一执行返回多个记录集"
var
Ado_tmp:TADODataset;
tmpId:integer;
begin
Ado_tmp:=TADODataSet.Create(Self);
Ado_tmp.Connection:=ADOConnection1;
with Ado_tmp do
try
Close;
ado_tmp.CommandType:=cmdText;
commandtext:='delete from treetxl where Id='+IntToStr(Id);
open;
finally
ado_tmp.Free;
end;
end;
老是报"当前提供程序不支持从单一执行返回多个记录集"
2:adodataset中根本没有execsql属性
wozhuchuanwei(单身一卒)说得没错,用ADOQuery组件,把Open改为ExecSQL就可以了