Page 1 of 1

Best way to replace TSQLDataset with TUniQuery

Posted: Wed 12 Sep 2012 12:29
by ecosoft.it
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

Re: Best way to replace TSQLDataset with TUniQuery

Posted: Fri 14 Sep 2012 12:28
by AndreyZ
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.