What is the difference between Tsqldataset, Tsqlquery, Tsqltable and Tsqlsimpledataset components?

Asked

Viewed 1,898 times

10

In Delphi, following the line of components TTable and TQuery in the component palette BDE we also have similar components in the palette dbExpress which are the TSQLQuery and the TSQLTable, and we still have the components TSQLDataSet and the TSQLSimpleDataSet.

I see for example that the TSQLSimpleDataSet incorporates properties and methods such as those of a ClientDataSet, the CreateDataSet, the Data and the Delta, as an example.
Surely such components exist because a specific purpose exists for each of them and they cannot all simply have the same purpose.

I believe that this is a basic foundation but of great importance for Delphi programmers

Then:
What is the difference between these components? A practical application would be interesting!
To be clear, I am asking about each component mentioned. Not by the palette BDE or the dbExpress.

2 answers

6


What is the reason for Tsimpledataset?

The set Tsqlquery + Tdatasetprovider + Tclientdataset has many features and is widely used but, there are cases of server client applications where the developer wants to use something simpler, something like a Tsimpledataset that is actually the aforementioned set incorporated into a single component.

What about Tsqlquery and Tsqldataset?

As can be seen in this link, Bruno Lichot (who was once an evangelist of Embarcadero in Brazil) explains that the Tsqlquery was mandido for compatibility and that the Tsqldataset is its evolution, doing the same things, but possessing more resources. Both are the objects of database queries.

And the Tsqltable?

It is a simpler database query tool, which does not make custom queries in the database, only loading the contents of a table, something like a 'SELECT * FROM table'

  • 1

    But you can tell if it exists YET specific cases for which each of them are most rexomended? + 1 for the good answer. Thank you!

  • 2

    @Thiagopsilva I do not know if there is a case of more recommended, I believe that, according to what they do, they adapt better to what the programmer wants to do but the TSimpleDataSet is most commonly used in client/server applications without datamodules and while the TSQLQuery/TSQLDataSet is maintained in the Datamodule so that multiple screens use it by connecting their providers or clientdatasets and the TTable when you want to list all the contents of the table

3

The COMIC(Borland Database Engine) was used in earlier versions of Delphi. Although not obsolete(yet?!), it is advisable to migrate to the dbExpress or Firedac.

The dbExpress was introduced from the version 6 of Delphi to replace the COMIC.

Currently the Firedac(if I’m not mistaken is available from the XE3) came to replace the dbExpress. The Firedac is undoubtedly a better solution, no doubt worth migrating your applications to COMIC or dbExpress for Firedac.

This article comments on something that should be of interest to you.

  • 2

    The content is good! + 1 But it must be by the time you were posting, because I asked the difference between the components of dbExpress, which will reflect the basic difference between the others as well . (rs) ;) Unless I was unclear or you wanted to supplement the subject.

  • I even edited the question to make it clearer. And thanks for the answer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.