想用CDS和DSP来开发数据库程序,如何设置cds的属性以便取得DSP的数据?

解决方案 »

  1.   

    TDataSetProvider provides data from a dataset and resolves updates to that dataset or its database server.UnitProviderDescriptionUse TDataSetProvider to provide data from a dataset to a client dataset or XML broker and to resolve updates from that client dataset or XML broker back to the dataset or to its underlying database server. TDataSetProvider can be a part of the same application as the client dataset or XML broker, or it can be placed in the application server of a multi-tiered application.  It serves as a data broker between a remote database server and a client dataset.TDataSetProvider packages data from a dataset and passes it in one or more transportable data packets to the client dataset or XML broker. When the provider supplies data to a client dataset, the client dataset reconstructs the data in the data packet to create a local, in-memory copy for user access. When user access is complete, the client dataset repackages any changed data and sends the updates back to the provider. The provider applies the updates to the database or source dataset.
    When the provider supplies data to an XML broker, the XML broker adds the data packet, in XML format, to an HTML document that is downloaded by a Web client. When the XML broker receives updates from the Web client, it sends the updates to the provider, which applies them to the database or source dataset.Client datasets and XML brokers communicate with a provider through the IAppServer interface. In multi-tiered applications, this is the interface of the remote data module that contains the provider. To enable the remote data module to pass calls to the provider, the provider抯 Exported property must be true, and its Owner property must specify the remote data module.
      

  2.   

    Applies updates received as a delta packet.Delphi syntax:function ApplyUpdates(const Delta: OleVariant; MaxErrors: Integer; out ErrorCount: Integer); OleVariant; overload;
    function ApplyUpdates(const Delta: OleVariant; MaxErrors: Integer; out ErrorCount: Integer; var OwnerData:OleVariant); OleVariant; overload;C++ syntax:virtual System::OleVariant __fastcall ApplyUpdates(const System::OleVariant &Delta, int MaxErrors, int &ErrorCount);
    virtual System::OleVariant __fastcall ApplyUpdates(const System::OleVariant &Delta, int MaxErrors, int &ErrorCount, System::OleVariant &OwnerData);DescriptionCall ApplyUpdates to apply updates contained in a delta packet. ApplyUpdates generates a BeforeApplyUpdates event, applies the updates, and then generates an AfterApplyUpdates event.Specify the delta packet as the Delta parameter. Use the MaxErrors parameter to indicate the maximum number of errors that can be applied before stopping the update operation. If MaxErrors is ?, the provider tries to apply all updates. ErrorCount returns the number of errors encountered during the update operation. The OwnerData parameter (if used) supplies custom information that is passed to the BeforeApplyUpdates event handler and which returns any information supplied by that event handler. ApplyUpdates returns a data packet (as an OleVariant) of updates that could not be applied to the database. Note: ApplyUpdates always generates the BeforeApplyUpdates and AfterApplyUpdates events, even if you use the syntax that does not include an OwnerData parameter. In that case, the value of OwnerData is nil (Delphi) or NULL (C++) on entry to the BeforeApplyUpdates event handler and is discarded on exit from the AfterApplyUpdates event handler.Warning: The provider can抰 detect when an update conflicts with another user抯 changes to a memo field. This situation will not contribute to the errors counted by ErrorCount.