Page 1 of 1

Can't return correct recordcount.

Posted: Mon 15 Aug 2011 09:12
by fb4819
SDAC 4.8+Delphi2007
While use TDataSetProvider ,TClientDataSet and TMSQuery to get data,there give incorrect recordcount

Code: Select all

ClientDataSet1.ProviderName:='DataSetProvider1';
DataSetProvider1.DataSet:=MSQuery1;

MSQuery1.Sql.Text:='SET NOCOUNT ON
select identity(int,1,1) id, 1 aid into a
select *  into b from (select 1 id,'001' v union select 1,'002') x
select a.id,b.v from a,b where a.id=b.id order by a.id
drop table a
drop table b';

ClientDataSet1.Data:=DataSetProvider1.Data;
In the abstract it will return two records but return one records .
It is happend while use UniDac 3.70


[/code]

Posted: Mon 15 Aug 2011 10:43
by Dimon
In order to solve this problem you should include the poRetainServerOrder option into TDataSetProvider.Options.

Posted: Mon 15 Aug 2011 13:11
by fb4819
Thanks verymuch! It's resolved my problem.