What is the difference between ADOTable and ClientDataSet

What is the difference between ADOTable and ClientDataSet ?
Both components are capable of performing batch updates, so add extra overhead with 2 additional components such as ClientDataSet and DataSetProvider .

+4
source share
4 answers

The main difference is that ClientDataSet can work without connecting to an external database. You can use it as a table in memory or load its contents from a file. In combination with DataSetProvider, it is often used to overcome the limits of unidirectional data sets and as a cache.

+3
source

ClientDataSet is an in-memory dataset that has many useful additional functionality. One big advantage over Interbase / Firebird tables and queries is that you do not need to support the transaction in real time, for example. while you show the data in the grid.

Take a look at this article: ClientDataSet in every database application

+3
source

The client dataset is a common implementation that works independently of the underlying db access library. It can work (through a provider) with any descendant of TCustomDataset, be it a dbExpress dataset, one BDE, ADO one or any of the many libraries available for Delphi to provide direct access to the database using its own client (i.e. ODAC, Direct Oracle Access, ecc. Ecc.)

It can also work in multi-level mode, where the data set and the data access provider are in the remote server application, and TClientDataset is in the client application, which allows you to deploy a "thin client" that does not require database clients or a data access library, such as ADO installed on the client (the required midas.dll code can be associated with the application when using the latest Delphi versions, in any case only the midas.dll file is required otherwise).

In addition, it can be used as a table in memory, capable of storing data in a local file. It also allows you to use the portfolio model, where the thin client can work when it is not connected to the database, and then β€œsynchronize” when the connection becomes available. This was more useful in the past when wireless access was not common.

As you can see, TClientDataset offers a lot more TADODataset.

+3
source

The most important difference I can think of is resolving update conflicts. In fact, TClientDataSet provides a convenient ReconcileErrorForm dialog that completes the process of showing the user old and new records and allows them to determine what action to take, while with TADOTable, for example, you are basically on your own.

0
source

Source: https://habr.com/ru/post/1384857/


All Articles