H
hsb0307
Unregistered / Unconfirmed
GUEST, unregistred user!
客户端数据集先执行:
procedure TForm1.Button3Click(Sender: TObject);
begin
if not DM.cktcn.Connected then
DM.cktcn.Connected:=true;
DM.cds.Close;
DM.cds.CommandText:='SELECT * FROM [sdField]';
DM.cds.Open;
end;
客户端数据集再执行:
procedure TForm1.Button4Click(Sender: TObject);
begin
DM.cds.Data:=DM.cds.DataRequest('FieldNo = 1');
end;
[red]报错:“在一个未打开的数据集上不能执行此操作”的原因是什么?[/red]
注:服务器端代码为Delphi帮助里的代码:
function TForm1.Provider1DataRequest(Sender: TObject;
Input: OleVariant): OleVariant;
begin
with (Sender as TDataSetProvider)do
begin
DataSet.Filter := Input;
DataSet.Filtered := True;
DataSet.First;
Result := Data;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
if not DM.cktcn.Connected then
DM.cktcn.Connected:=true;
DM.cds.Close;
DM.cds.CommandText:='SELECT * FROM [sdField]';
DM.cds.Open;
end;
客户端数据集再执行:
procedure TForm1.Button4Click(Sender: TObject);
begin
DM.cds.Data:=DM.cds.DataRequest('FieldNo = 1');
end;
[red]报错:“在一个未打开的数据集上不能执行此操作”的原因是什么?[/red]
注:服务器端代码为Delphi帮助里的代码:
function TForm1.Provider1DataRequest(Sender: TObject;
Input: OleVariant): OleVariant;
begin
with (Sender as TDataSetProvider)do
begin
DataSet.Filter := Input;
DataSet.Filtered := True;
DataSet.First;
Result := Data;
end;
end;