Page 1 of 1

Update failed. Found 0 records

Posted: Wed 29 May 2013 15:56
by DiGi
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

Re: Update failed. Found 0 records

Posted: Thu 30 May 2013 07:37
by AndreyZ
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.