Can't return correct recordcount.

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
fb4819
Posts: 2
Joined: Mon 15 Aug 2011 08:37

Can't return correct recordcount.

Post by fb4819 » Mon 15 Aug 2011 09:12

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]

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 15 Aug 2011 10:43

In order to solve this problem you should include the poRetainServerOrder option into TDataSetProvider.Options.

fb4819
Posts: 2
Joined: Mon 15 Aug 2011 08:37

Post by fb4819 » Mon 15 Aug 2011 13:11

Thanks verymuch! It's resolved my problem.

Post Reply