Ver Mensaje Individual
  #19  
Antiguo 25-05-2010
Avatar de guillotmarc
guillotmarc guillotmarc is offline
Miembro
 
Registrado: may 2003
Ubicación: Huelva
Posts: 2.638
Reputación: 24
guillotmarc Va por buen camino
Nadie dice que no sirva, pero nunca se diseñó para eso. Como el mismo nombre indica, el ClientDataset es para mantener un Dataset (conjunto de registros) en memoria, en la parte cliente de tu aplicación (y para actualizar sus modificaciones).

Solo tienes que leer lo que dice al respecto la documentación de Delphi :

Cita:
TClientDataset

TClientDataSet implements a database-independent dataset.

Unit

DBClient

Description

TClientDataSet represents an in-memory dataset. A client dataset can be used as

* A fully-functional, stand-alone, file-based dataset for single-tiered database applications. When used in this manner, the client dataset represents the data stored in a dedicated file on the user’s hard disk.

* A local in-memory buffer of the records from another dataset. The other (source) dataset can reside in the same form or data module as the client dataset (for example, when the client dataset provides navigation and editing support for the data from a unidirectional dataset). The source dataset can also reside on a separate system when the client dataset supports the client portion of a multi-tiered database application.

Note: The two functions described above are not mutually exclusive. An application can be designed to support the option of working with data offline, using the “briefcase” model. On site, the application uses TClientDataSet to communicate with the database server associated with a source dataset. When a user works off site, the client dataset writes a snapshot of the data to the hard disk. The application works with this snapshot off site, with the client dataset acting as a file-based dataset in a single-tiered application.

When a client dataset represents the data from another dataset, it communicates with that dataset through a dataset provider. The client dataset communicates with this provider through the IAppServer interface. When the provider is in the same form or data module as the client dataset, the IAppServer interface is implemented by a hidden object that is created for you. When used in a client application as part of a multi-tiered application, the client dataset passes all calls to the provider through a remote data module’s IAppServer interface.
No encontrarás la menor referencia a usar un ClientDataset para lanzar directamente consultas de actualización (ya vengan de procedimientos almacenados, consultas simples, ...). Repito, un ClientDataset es para mantener un Dataset en memoria.

Naturalmente puedes utilizarlo para otros menesteres, y hasta cabe la posibilidad de que incluso te funcione. Pero se trabaja mejor si utilizas la herramienta adecuada para cada tarea. Por ejemplo, matar mosquitos a cañonazos no siempre es buena idea, por divertido y atractivo que pueda parecer en un principio.
__________________
Marc Guillot (Hi ha 10 tipus de persones, els que saben binari i els que no).

Última edición por guillotmarc fecha: 25-05-2010 a las 16:46:31.
Responder Con Cita