DataSource.DataSet.CommandText

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
heerdinm
Posts: 14
Joined: Fri 14 Dec 2012 11:35

DataSource.DataSet.CommandText

Post by heerdinm » Sun 30 Dec 2012 20:19

Hello,

I am converting my ADODataSource to a TUniDataSource.
With an ADODataSource, i can do something like this:

TADODataSet(DbGrid.DataSource.DataSet).CommandText

I would like to do the same with UniDAC.
What i have now is:

TUniDataSource(DbGrid.DataSource).DataSet.

I can not use CommandText, because it is not part of the TUniDataSource property list.
What i would like is the currently used SQL in the DataSource. How should i be doing this to get the SQL that is used?

I use a TUniDataSource with a TUniTable.
If i should be using other components, please do tell :)

heerdinm
Posts: 14
Joined: Fri 14 Dec 2012 11:35

Re: DataSource.DataSet.CommandText

Post by heerdinm » Sun 30 Dec 2012 20:31

Ok, i found:

TUniTable(grd.DataSource.DataSet).FinalSQL

Would be happy to know if i am still on the right track.
I have used TADOData.... for so many years now that i kind of forgot how it is done without them :)

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: DataSource.DataSet.CommandText

Post by AlexP » Wed 02 Jan 2013 10:56

Hello,

To get the text of the SQL query being executed, you can use the FinalSQL property, in this case the final query will be displayed (including all conditions added with the help of the methods AddWhere, FilterSQL, etc.), to view the initial SQL query, you can use the BaseSQL property.

Post Reply