Best way to replace TSQLDataset with TUniQuery

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ecosoft.it
Posts: 12
Joined: Thu 01 Dec 2011 14:36
Contact:

Best way to replace TSQLDataset with TUniQuery

Post by ecosoft.it » Wed 12 Sep 2012 12:29

Hello,
I have begun to test UniDac in order to replace DBExpress.
I have created a tool that converts TSQLDataSet into TUniQuery in "pas" and "dfm".
In my project I use TSQLDataSet directly or TSQLDataSet+TDataSetProvider+TClientDataSet with your DBExpress driver (Firebird - SQLServr).

First solution is:
TUniQuery.Unidirectional := TRUE;
TUniQuery.SQL.Text := TSQLDataSet.CommandText;

In order to replace
TSQLDataSet.GetMetadata := false; ??
In TUniQuery+TDataSetProvider+TClientDataSet, TUniQuery (unidirectional) doesn't use buffer? (In order not to have 2 buffers that record (TUniQuery and TClientDataSet))

Main question:
What is the best way to replace TSQLDataSet?

Thank you
Alessandro Savoiardo

AndreyZ

Re: Best way to replace TSQLDataset with TUniQuery

Post by AndreyZ » Fri 14 Sep 2012 12:28

Hello,

TUniQuery does not have the analog for the TSQLDataSet.GetMetadata property. TUniQuery does not obtain the information about indexes (as TSQLDataSet.GetMetadata=True does) from the server, it is not needed. TUniQuery uses primary key fields to generate the optimized SQL code to perform for modifications.

If you use the TUniQuery->TDataSetProvider->TClientDataSet components sequence, setting the TUniQuery.UniDirectional property to True guarantees that TUniQuery does not allocate memory for the whole dataset. In this case, you will not have two buffers.
What is the best way to replace TSQLDataSet?
TUniQuery.

Post Reply