我写了如下的代码,
with DataModule1.ClientDataSet1 do
begin
if active then close;
s:='select * from test ';
commandtext:=s;
open;
end;
在中间层可以看到语句执行的输入,但执行完成后立即关闭了,在客户端无法得到返回的结果,我该怎样设置才能得到返回的结果呢?
with DataModule1.ClientDataSet1 do
begin
if active then close;
s:='select * from test ';
commandtext:=s;
open;
end;
在中间层可以看到语句执行的输入,但执行完成后立即关闭了,在客户端无法得到返回的结果,我该怎样设置才能得到返回的结果呢?
这样地代码应该没有问题的,你也可以在
设计环境设置CommandText,然后active:=true;
用一个DBGrid试试。
>>执行完成后立即关闭
你指的是什么关闭了?