RowsAffected in Direct Mode

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ysyang
Posts: 41
Joined: Tue 14 Jun 2005 09:10

RowsAffected in Direct Mode

Post by ysyang » Fri 15 May 2015 01:40

Hi
SQL is

Code: Select all

insert into objects select * from sys.objects
delete FROM dbo.objects where type = 'S'
if Connection Provider is prNativeClient, result is

Code: Select all

(1194 row(s) affected)
(67 row(s) affected)

but if Connection Provider is prDirect, result is

Code: Select all

(67 row(s) affected)


return last RowsAffected value.
How can receive all RowsAffected values ?
Thank you

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: RowsAffected in Direct Mode

Post by azyk » Fri 15 May 2015 09:32

SDAC doesn't allow to get the number of affected records for each SQL query separately - neither in Direct mode, nor when using SQL Native Client provider. The RowsAffected property contains the number of affected rows for the last executed SQL query only.

ysyang
Posts: 41
Joined: Tue 14 Jun 2005 09:10

Re: RowsAffected in Direct Mode

Post by ysyang » Mon 18 May 2015 14:39

I understand your opinion but the following code goes in doubt.

SQL is

Code: Select all

SET NO_BROWSETABLE ON
if Connection Provider is prNativeClient, RowsAffected is -1
but Connection Provider is prDirect, RowsAffected is 0

Please check again
Thank you

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: RowsAffected in Direct Mode

Post by azyk » Tue 19 May 2015 08:43

We couldn't reproduce the problem. Please compose a small sample, in which you are executing the SQL query and retrieving the value from the RowsAffected property. Send it to andreyz*devart*com .

Post Reply