Update failed. Found 0 records

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
DiGi
Posts: 2
Joined: Fri 24 Feb 2012 14:37

Update failed. Found 0 records

Post by DiGi » Wed 29 May 2013 15:56

I'm "downgrading" from old UniDac to current SDAC (because we want TABLE parameters etc.)

My trouble is:
Project SDAC_TestProject.exe raised exception class EDatabaseError with message 'Update failed. Found 0 records'.
My discovers:
  • UniDAC is working fine, without trouble, StrictUpdate = True
  • Trouble is any text before "(1 rows affected)". It can be PRINT, "Warning: Null value is eliminated by an aggregate or other SET operation." (our case) or update to another table (with 0 rows affected).
  • Both sources contains same line: hr := ICommand(FICommandText).Execute(nil, RequestInt, pParams, FRowsAffected, Result);. SDAC got FRowsAffected = -1, UniDAC got 1. (OLEDBAccess.pas, line 6486 in current SDAC).
  • I changed Provider but both works same
  • Old ADO have similar issue, but with better message "someone changed row before you"
  • I know about Options.StrictUpdate but I'm not sure if I want bypass this nice check
I don't know why it is working in UniDAC.

SDAC version:
Microsoft SQL Server: 11.00.3000
Microsoft SQL Server Native Client 11.0: 11.0.2316.0
Old UniDac version:
Server version: Microsoft SQL Server 11.00.3000
Client version: 06.01.7601
Test application (db script, SDAC and UniDac projects. Target sql server name is DEV):

https://www.sugarsync.com/pf/D6021878_609_973501885

AndreyZ

Re: Update failed. Found 0 records

Post by AndreyZ » Thu 30 May 2013 07:37

To solve the problem, you should set the DMLRefresh option of the TMSStoredProc component to True. DMLRefresh is used to refresh a record when insertion or update is performed.

Post Reply