一个com组件返回一个_recordset型数据(一个数据集),我定义了一个对象,怎样让返回的值赋给这个对象,还有 _recorderset.open又很多参数,能说一下么

解决方案 »

  1.   

    ADOTable1.Rcordset 返回这种类型的
    别的ADO组件也是
      

  2.   

    _recordset is an interface type, be defined in ADOInt unit.
    An example:
      ADOQuery2.Close;
      ADOQuery2.Recordset := ComObject.MethodName; 
      // ComObject.MethodName returns a _recordset, and then ADOQuery2 will be Opened, 
      // please look the code in ADODB unit:
      {
        procedure TCustomADODataSet.SetRecordset(const Value: _Recordset);
        begin
          Close;
          if Assigned(Value) then
          try
            if (Value.State and adStateOpen) = 0 then
              DatabaseError(SRecordsetNotOpen, Self);
            FRecordsetObject := Value;
            Open;  // Be Opene;
          except
            Close;
            raise;
          end;
        end;
      }
      

  3.   

    _recordset是ADO 定义的接口之一。对应DELPHI中TADODATASET对它进行了封装就象楼上说的那样。